...
 
Commits (3)
......@@ -56,6 +56,7 @@ check_linting:
script:
- src/tooling/lint.sh check.ci
- src/tooling/lint.sh check_scripts
- src/tooling/lint.sh check.ocamlformat
check_python_linting:
<<: *build_definition
......
wrap-fun-args=false
let-binding-spacing=compact
field-space=loose
break-separators=after-and-docked
sequence-style=separator
doc-comments=before
margin=80
module-item-spacing=sparse
parens-tuple=always
parens-tuple-patterns=always
break-string-literals=newlines-and-wrap
wrap-fun-args=false
let-binding-spacing=compact
field-space=loose
break-separators=after-and-docked
sequence-style=separator
doc-comments=before
margin=80
module-item-spacing=sparse
parens-tuple=always
parens-tuple-patterns=always
break-string-literals=newlines-and-wrap
wrap-fun-args=false
let-binding-spacing=compact
field-space=loose
break-separators=after-and-docked
sequence-style=separator
doc-comments=before
margin=80
module-item-spacing=sparse
parens-tuple=always
parens-tuple-patterns=always
break-string-literals=newlines-and-wrap
......@@ -78,10 +78,10 @@ roll_repr.mli
roll_storage.ml
roll_storage.mli
script_expr_hash.ml
script_interpreter.ml
script_interpreter.mli
script_int_repr.ml
script_int_repr.mli
script_interpreter.ml
script_interpreter.mli
script_ir_annot.ml
script_ir_annot.mli
script_ir_translator.ml
......@@ -99,12 +99,12 @@ seed_storage.ml
seed_storage.mli
services_registration.ml
state_hash.ml
storage.ml
storage.mli
storage_description.ml
storage_description.mli
storage_functors.ml
storage_functors.mli
storage.ml
storage.mli
storage_sigs.ml
tez_repr.ml
tez_repr.mli
......
......@@ -78,10 +78,10 @@ roll_repr.mli
roll_storage.ml
roll_storage.mli
script_expr_hash.ml
script_interpreter.ml
script_interpreter.mli
script_int_repr.ml
script_int_repr.mli
script_interpreter.ml
script_interpreter.mli
script_ir_annot.ml
script_ir_annot.mli
script_ir_translator.ml
......@@ -99,12 +99,12 @@ seed_storage.ml
seed_storage.mli
services_registration.ml
state_hash.ml
storage.ml
storage.mli
storage_description.ml
storage_description.mli
storage_functors.ml
storage_functors.mli
storage.ml
storage.mli
storage_sigs.ml
tez_repr.ml
tez_repr.mli
......
......@@ -78,10 +78,10 @@ roll_repr.mli
roll_storage.ml
roll_storage.mli
script_expr_hash.ml
script_interpreter.ml
script_interpreter.mli
script_int_repr.ml
script_int_repr.mli
script_interpreter.ml
script_interpreter.mli
script_ir_annot.ml
script_ir_annot.mli
script_ir_translator.ml
......@@ -99,12 +99,12 @@ seed_storage.ml
seed_storage.mli
services_registration.ml
state_hash.ml
storage.ml
storage.mli
storage_description.ml
storage_description.mli
storage_functors.ml
storage_functors.mli
storage.ml
storage.mli
storage_sigs.ml
tez_repr.ml
tez_repr.mli
......
......@@ -78,10 +78,10 @@ roll_repr.mli
roll_storage.ml
roll_storage.mli
script_expr_hash.ml
script_interpreter.ml
script_interpreter.mli
script_int_repr.ml
script_int_repr.mli
script_interpreter.ml
script_interpreter.mli
script_ir_annot.ml
script_ir_annot.mli
script_ir_translator.ml
......@@ -99,12 +99,12 @@ seed_storage.ml
seed_storage.mli
services_registration.ml
state_hash.ml
storage.ml
storage.mli
storage_description.ml
storage_description.mli
storage_functors.ml
storage_functors.mli
storage.ml
storage.mli
storage_sigs.ml
tez_repr.ml
tez_repr.mli
......
......@@ -80,10 +80,10 @@ roll_repr.mli
roll_storage.ml
roll_storage.mli
script_expr_hash.ml
script_interpreter.ml
script_interpreter.mli
script_int_repr.ml
script_int_repr.mli
script_interpreter.ml
script_interpreter.mli
script_ir_annot.ml
script_ir_annot.mli
script_ir_translator.ml
......@@ -101,12 +101,12 @@ seed_storage.ml
seed_storage.mli
services_registration.ml
state_hash.ml
storage.ml
storage.mli
storage_description.ml
storage_description.mli
storage_functors.ml
storage_functors.mli
storage.ml
storage.mli
storage_sigs.ml
tez_repr.ml
tez_repr.mli
......
......@@ -80,10 +80,10 @@ roll_repr.mli
roll_storage.ml
roll_storage.mli
script_expr_hash.ml
script_interpreter.ml
script_interpreter.mli
script_int_repr.ml
script_int_repr.mli
script_interpreter.ml
script_interpreter.mli
script_ir_annot.ml
script_ir_annot.mli
script_ir_translator.ml
......@@ -101,12 +101,12 @@ seed_storage.ml
seed_storage.mli
services_registration.ml
state_hash.ml
storage.ml
storage.mli
storage_description.ml
storage_description.mli
storage_functors.ml
storage_functors.mli
storage.ml
storage.mli
storage_sigs.ml
tez_repr.ml
tez_repr.mli
......
alpha_context.ml
alpha_context.mli
alpha_services.ml
alpha_services.mli
amendment.ml
amendment.mli
apply.ml
apply_results.ml
apply_results.mli
baking.ml
baking.mli
blinded_public_key_hash.ml
blinded_public_key_hash.mli
block_header_repr.ml
block_header_repr.mli
bootstrap_storage.ml
bootstrap_storage.mli
commitment_repr.ml
commitment_repr.mli
commitment_storage.ml
commitment_storage.mli
constants_repr.ml
constants_services.ml
constants_services.mli
constants_storage.ml
contract_hash.ml
contract_repr.ml
contract_repr.mli
contract_services.ml
contract_services.mli
contract_storage.ml
contract_storage.mli
cycle_repr.ml
cycle_repr.mli
delegate_services.ml
delegate_services.mli
delegate_storage.ml
delegate_storage.mli
fees_storage.ml
fees_storage.mli
fitness_repr.ml
fitness_storage.ml
gas_limit_repr.ml
gas_limit_repr.mli
helpers_services.ml
helpers_services.mli
init_storage.ml
legacy_script_support_repr.ml
legacy_script_support_repr.mli
level_repr.ml
level_repr.mli
level_storage.ml
level_storage.mli
main.ml
main.mli
manager_repr.ml
manager_repr.mli
michelson_v1_gas.ml
michelson_v1_gas.mli
michelson_v1_primitives.ml
michelson_v1_primitives.mli
misc.ml
misc.mli
nonce_hash.ml
nonce_storage.ml
nonce_storage.mli
operation_repr.ml
operation_repr.mli
parameters_repr.ml
parameters_repr.mli
period_repr.ml
period_repr.mli
qty_repr.ml
raw_context.ml
raw_context.mli
raw_level_repr.ml
raw_level_repr.mli
roll_repr.ml
roll_repr.mli
roll_storage.ml
roll_storage.mli
script_expr_hash.ml
script_int_repr.ml
script_int_repr.mli
script_interpreter.ml
script_interpreter.mli
script_ir_annot.ml
script_ir_annot.mli
script_ir_translator.ml
script_ir_translator.mli
script_repr.ml
script_repr.mli
script_tc_errors.ml
script_tc_errors_registration.ml
script_timestamp_repr.ml
script_timestamp_repr.mli
script_typed_ir.ml
seed_repr.ml
seed_repr.mli
seed_storage.ml
seed_storage.mli
services_registration.ml
state_hash.ml
storage.ml
storage.mli
storage_description.ml
storage_description.mli
storage_functors.ml
storage_functors.mli
storage_sigs.ml
tez_repr.ml
tez_repr.mli
time_repr.ml
time_repr.mli
vote_repr.ml
vote_repr.mli
vote_storage.ml
vote_storage.mli
voting_period_repr.ml
voting_period_repr.mli
voting_services.ml
voting_services.mli
apply.ml
apply.mli
error.ml
error.mli
header.ml
header.mli
main.ml
main.mli
proto_operation.ml
proto_operation.mli
proto_params.ml
proto_params.mli
receipt.ml
receipt.mli
services.ml
services.mli
state.ml
state.mli
......@@ -8,6 +8,7 @@ Where <action> can be:
* update.ocamlformat: update all the \`.ocamlformat\` files and
git-commit (requires clean repo).
* check.ocamlformat: check the above does nothing.
* check.dune: check formatting while assuming running under Dune's
rule (\`dune build @runtest_lint\`).
* check.ci: check formatting using git (for GitLabCI's verbose run).
......@@ -61,7 +62,7 @@ EOF
source_directories="src docs/doc_gen"
update_all_dot_ocamlformats () {
interesting_directories=$(find $source_directories \( -name "*.ml" -o -name "*.mli" \) -type f | sed 's:/[^/]*$::' | sort -u)
interesting_directories=$(find $source_directories \( -name "*.ml" -o -name "*.mli" \) -type f | sed 's:/[^/]*$::' | LC_COLLATE=C sort -u)
if git diff --name-only HEAD --exit-code
then
say "Repository clean :thumbsup:"
......@@ -80,7 +81,7 @@ update_all_dot_ocamlformats () {
src/proto_*/lib_protocol )
say "This a protocol"
make_dot_ocamlformat "$ofmt"
( cd "$d" ; ls -1 *.mli *.ml > .ocamlformat-ignore ; )
( cd "$d" ; ls -1 *.mli *.ml | LC_COLLATE=C sort > .ocamlformat-ignore ; )
git add "$d/.ocamlformat-ignore"
;;
* )
......@@ -89,7 +90,6 @@ update_all_dot_ocamlformats () {
esac
git add "$ofmt"
done
git commit -m 'Update .ocamlformat files'
}
check_with_dune () {
......@@ -138,7 +138,11 @@ fi
case "$action" in
"update.ocamlformat" )
update_all_dot_ocamlformats ;;
update_all_dot_ocamlformats
git commit -m 'Update .ocamlformat files' ;;
"check.ocamlformat" )
update_all_dot_ocamlformats
git diff --name-only HEAD --exit-code ;;
"check.dune" )
check_with_dune $files ;;
"check.ci" )
......