Commit 57a2c094 authored by Daniel Garcia Moreno's avatar Daniel Garcia Moreno

Merge branch 'setup-fmt' into 'master'

Setup pre-commit hook to check style

See merge request World/fractal!292
parents f953f892 f857e72e
Pipeline #44640 passed with stages
in 27 minutes and 48 seconds
if ! which rustup &> /dev/null; then
curl -sSf | sh -s -- -y
export PATH=$PATH:$HOME/.cargo/bin
if ! which rustup &> /dev/null; then
echo "Failed to install rustup"
if ! rustup component list --toolchain nightly|grep rustfmt-preview &> /dev/null; then
echo "Installing nightly rustfmt.."
rustup component add rustfmt-preview --toolchain nightly
echo "--Checking style--"
cargo +nightly fmt --all -- --check
if test $? != 0; then
echo "--Checking style fail--"
echo "Please fix the above issues, either manually or by running: cargo +nightly fmt --all"
exit -1
echo "--Checking style pass--"
......@@ -98,4 +98,10 @@ run_target('release', command: ['scripts/',
meson.project_name() + '-' + fractal_version
if get_option('profile') == 'development'
# Setup pre-commit hook for ensuring coding style is always consistent
message('Setting up git pre-commit hook..')
run_command('cp', '-f', 'hooks/pre-commit.hook', '.git/hooks/pre-commit')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment