Reindent all files
Now `make test` fails when sources are not indented correctly, the indentation test is also executed in the CI.
This commit is contained in:
parent
32a466556e
commit
6ecfca9396
@ -72,6 +72,11 @@ build:
|
|||||||
dependencies:
|
dependencies:
|
||||||
- build
|
- build
|
||||||
|
|
||||||
|
test:ocp-indent:
|
||||||
|
<<: *test_definition
|
||||||
|
script:
|
||||||
|
- jbuilder build @runtest_indent
|
||||||
|
|
||||||
test:utils:
|
test:utils:
|
||||||
<<: *test_definition
|
<<: *test_definition
|
||||||
script:
|
script:
|
||||||
|
62
jbuild
62
jbuild
@ -1 +1,63 @@
|
|||||||
(jbuild_version 1)
|
(jbuild_version 1)
|
||||||
|
|
||||||
|
(alias
|
||||||
|
((name runtest_indent)
|
||||||
|
(deps ( ;; Hack... list all directories
|
||||||
|
(glob_files scripts/*.ml)
|
||||||
|
(glob_files scripts/*.mli)
|
||||||
|
(glob_files src/*.ml)
|
||||||
|
(glob_files src/*.mli)
|
||||||
|
(glob_files src/attacker/*.ml)
|
||||||
|
(glob_files src/attacker/*.mli)
|
||||||
|
(glob_files src/client/*.ml)
|
||||||
|
(glob_files src/client/*.mli)
|
||||||
|
(glob_files src/client/embedded/alpha/*.ml)
|
||||||
|
(glob_files src/client/embedded/alpha/*.mli)
|
||||||
|
(glob_files src/client/embedded/demo/*.ml)
|
||||||
|
(glob_files src/client/embedded/demo/*.mli)
|
||||||
|
(glob_files src/client/embedded/genesis/*.ml)
|
||||||
|
(glob_files src/client/embedded/genesis/*.mli)
|
||||||
|
(glob_files src/compiler/*.ml)
|
||||||
|
(glob_files src/compiler/*.mli)
|
||||||
|
(glob_files src/environment/sigs_packer/*.ml)
|
||||||
|
(glob_files src/environment/sigs_packer/*.mli)
|
||||||
|
(glob_files src/environment/v1/*.ml)
|
||||||
|
(glob_files src/environment/v1/*.mli)
|
||||||
|
(glob_files src/micheline/*.ml)
|
||||||
|
(glob_files src/micheline/*.mli)
|
||||||
|
(glob_files src/minutils/*.ml)
|
||||||
|
(glob_files src/minutils/*.mli)
|
||||||
|
(glob_files src/node/db/*.ml)
|
||||||
|
(glob_files src/node/db/*.mli)
|
||||||
|
(glob_files src/node/main/*.ml)
|
||||||
|
(glob_files src/node/main/*.mli)
|
||||||
|
(glob_files src/node/net/*.ml)
|
||||||
|
(glob_files src/node/net/*.mli)
|
||||||
|
(glob_files src/node/shell/*.ml)
|
||||||
|
(glob_files src/node/shell/*.mli)
|
||||||
|
(glob_files src/node/updater/*.ml)
|
||||||
|
(glob_files src/node/updater/*.mli)
|
||||||
|
(glob_files src/proto/alpha/*.ml)
|
||||||
|
(glob_files src/proto/alpha/*.mli)
|
||||||
|
(glob_files src/proto/demo/*.ml)
|
||||||
|
(glob_files src/proto/demo/*.mli)
|
||||||
|
(glob_files src/proto/genesis/*.ml)
|
||||||
|
(glob_files src/proto/genesis/*.mli)
|
||||||
|
(glob_files src/utils/*.ml)
|
||||||
|
(glob_files src/utils/*.mli)
|
||||||
|
(glob_files test/lib/*.ml)
|
||||||
|
(glob_files test/lib/*.mli)
|
||||||
|
(glob_files test/p2p/*.ml)
|
||||||
|
(glob_files test/p2p/*.mli)
|
||||||
|
(glob_files test/proto_alpha/*.ml)
|
||||||
|
(glob_files test/proto_alpha/*.mli)
|
||||||
|
(glob_files test/shell/*.ml)
|
||||||
|
(glob_files test/shell/*.mli)
|
||||||
|
(glob_files test/utils/*.ml)
|
||||||
|
(glob_files test/utils/*.mli)
|
||||||
|
))
|
||||||
|
(action (run bash ${path:scripts/test-ocp-indent.sh}))))
|
||||||
|
|
||||||
|
(alias
|
||||||
|
((name runtest)
|
||||||
|
(deps ((alias runtest_indent)))))
|
||||||
|
22
scripts/test-ocp-indent.sh
Executable file
22
scripts/test-ocp-indent.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
tmp_dir="$(mktemp -d -t tezos_build.XXXXXXXXXX)"
|
||||||
|
failed=no
|
||||||
|
|
||||||
|
for f in ` find \( -name _build -or \
|
||||||
|
-name .git -or \
|
||||||
|
-wholename ./src/environment/v1.ml -or \
|
||||||
|
-name registerer.ml \) -prune -or \
|
||||||
|
\( -name \*.ml -or -name \*.mli \) -print`; do
|
||||||
|
ff=$(basename $f)
|
||||||
|
ocp-indent $f > $tmp_dir/$ff
|
||||||
|
diff -u --color $f $tmp_dir/$ff
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
failed=yes
|
||||||
|
fi
|
||||||
|
rm -f $tmp_dir/$ff $tmp_dir/$ff.diff
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ $failed = "yes" ]; then
|
||||||
|
exit 2
|
||||||
|
fi
|
@ -76,7 +76,7 @@ let begin_construction
|
|||||||
~predecessor:_
|
~predecessor:_
|
||||||
~timestamp:_
|
~timestamp:_
|
||||||
?proto_header:_ () =
|
?proto_header:_ () =
|
||||||
Fitness.to_int64 pred_fitness >>=? function pred_fitness ->
|
Fitness.to_int64 pred_fitness >>=? fun pred_fitness ->
|
||||||
let fitness = Int64.succ pred_fitness in
|
let fitness = Int64.succ pred_fitness in
|
||||||
return { context ; fitness }
|
return { context ; fitness }
|
||||||
|
|
||||||
|
10
test/jbuild
10
test/jbuild
@ -26,8 +26,8 @@
|
|||||||
../scripts/client_lib.inc.sh
|
../scripts/client_lib.inc.sh
|
||||||
(glob_files contracts/*)
|
(glob_files contracts/*)
|
||||||
))
|
))
|
||||||
(locks (/tcp-port/18732
|
(locks (/tcp-port/18731
|
||||||
/tcp-port/19732))
|
/tcp-port/19731))
|
||||||
(action (run bash ${path:test_contracts.sh}))))
|
(action (run bash ${path:test_contracts.sh}))))
|
||||||
|
|
||||||
(alias
|
(alias
|
||||||
@ -46,3 +46,9 @@
|
|||||||
/tcp-port/19731 /tcp-port/19732 /tcp-port/19733 /tcp-port/19734
|
/tcp-port/19731 /tcp-port/19732 /tcp-port/19733 /tcp-port/19734
|
||||||
/tcp-port/19735 /tcp-port/19736 /tcp-port/19737 /tcp-port/19738))
|
/tcp-port/19735 /tcp-port/19736 /tcp-port/19737 /tcp-port/19738))
|
||||||
(action (run bash ${path:test_multinode.sh}))))
|
(action (run bash ${path:test_multinode.sh}))))
|
||||||
|
|
||||||
|
(alias
|
||||||
|
((name runtest)
|
||||||
|
(deps ((alias runtest_basic.sh)
|
||||||
|
(alias runtest_contracts.sh)
|
||||||
|
(alias runtest_multinode.sh)))))
|
||||||
|
@ -6,7 +6,7 @@ set -o pipefail
|
|||||||
test_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)")"
|
test_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)")"
|
||||||
source $test_dir/lib/test_lib.inc.sh
|
source $test_dir/lib/test_lib.inc.sh
|
||||||
|
|
||||||
start_node 2
|
start_node 1
|
||||||
activate_alpha
|
activate_alpha
|
||||||
|
|
||||||
key1=foo
|
key1=foo
|
||||||
|
Loading…
Reference in New Issue
Block a user