From 59927c5fece035a0e34ef47e8e428ee448c47c3f Mon Sep 17 00:00:00 2001 From: Sebastien Mondet Date: Mon, 12 Aug 2019 12:55:07 -0400 Subject: [PATCH 1/5] lint: switch to ocamlformat (except lib_protocol) --- .gitlab-ci.yml | 2 +- Makefile | 4 +- src/tooling/lint.sh | 185 +++++++++++++++++++++++---------- src/tooling/tezos-tooling.opam | 2 +- 4 files changed, 132 insertions(+), 61 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7495d2db2eac..6e428b939ee9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -56,7 +56,7 @@ check_opam_lint: check_linting: <<: *build_definition script: - - dune build @runtest_lint + - src/tooling/lint.sh check.ci build: <<: *build_definition diff --git a/Makefile b/Makefile index 19f16eadb5db..dd7fda758ec1 100644 --- a/Makefile +++ b/Makefile @@ -97,8 +97,8 @@ test-lint: @dune build @runtest_lint make -C tests_python lint_all -fix-lint: - @src/tooling/lint.sh fix +fmt: + @src/tooling/lint.sh format build-deps: @./scripts/install_build_deps.sh diff --git a/src/tooling/lint.sh b/src/tooling/lint.sh index 53e72832b4c7..a79911fbbdf5 100755 --- a/src/tooling/lint.sh +++ b/src/tooling/lint.sh @@ -1,20 +1,29 @@ -#!/bin/bash +#!/bin/sh -## Testing for dependencies +usage () { + cat >&2 <] [FILES] -type ocp-indent > /dev/null 2>&- -if [ $? -ne 0 ]; then - echo "ocp-indent is required but could not be found. Aborting." - exit 1 -fi -type perl > /dev/null 2>&- -if [ $? -ne 0 ]; then - echo "perl is required but could not be found. Aborting." - exit 1 -fi -type diff > /dev/null 2>&- +Where can be: + +* update.ocamlformat: update all the \`.ocamlformat\` files and + git-commit (requires clean repo). +* 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). +* format: format all the files, see also \`make fmt\`. +* help: display this and return 0. + +If the first argument is a file, action 'check.dune' is assumed. + +If no files are provided all .ml, .mli, mlt files are formatted/checked. +EOF +} + +## Testing for dependencies +type ocamlformat > /dev/null 2>&- if [ $? -ne 0 ]; then - echo "diff is required but could not be found. Aborting." + echo "ocamlformat is required but could not be found. Aborting." exit 1 fi type find > /dev/null 2>&- @@ -23,54 +32,116 @@ if [ $? -ne 0 ]; then exit 1 fi -## Setup: temporary directory, failure witness flag, minimal argument parsing -tmp_dir="$(mktemp -d -t tezos_build.XXXXXXXXXX)" -failed=no -if [ "$1" = "fix" ]; then - fix=yes - shift 1 -fi +set -e -## Main argument parsing - -files="$@" -if [ -z "$files" ]; then -files=` find . \( -name _build -or \ - -name .git -or \ - -name _opam -or \ - -wholename ./src/environment/v1.ml -or \ - -name ocplib-json-typed -or \ - -name registerer.ml \) -prune -or \ - \( -name \*.ml -or -name \*.mli \) -print` -fi +say () { + echo "$*" >&2 +} + + +make_dot_ocamlformat () { + local path="$1" + cat > "$path" < .ocamlformat-ignore ; ) + git add "$d/.ocamlformat-ignore" + ;; + * ) + make_dot_ocamlformat "$ofmt" + ;; + esac + git add "$ofmt" + done + git commit -m 'Update .ocamlformat files' +} -rm -rf $tmp_dir +check_with_dune () { + for f in $* ; do + say "Checking '$f'" + case "$PWD" in + */src/proto_demo_noops/lib_protocol$ ) + make_dot_ocamlformat .ocamlformat + ocamlformat --check $f && say "Success!" + ;; + */src/proto_*/lib_protocol$ ) + say "This a protocol file, ignoring" + ;; + * ) + make_dot_ocamlformat .ocamlformat + ocamlformat --check $f && say "Success!" + ;; + esac + done +} -if [ $failed = "yes" ]; then - exit 2 + +if [ -f "$1" ] ; then + say "Assuming action: check.dune" + action=check.dune + files="$@" +else + action="$1" + shift + files="$@" + if [ "$files" = "" ]; then + files=$(find $source_directories \( -name "*.ml" -o -name "*.mli" -o -name "*.mlt" \) -type f -print) + fi fi + +case "$action" in + "update.ocamlformat" ) + update_all_dot_ocamlformats ;; + "check.dune" ) + check_with_dune $files ;; + "check.ci" ) + say "Formatting for CI-test $files" + ocamlformat --inplace $files + git diff --exit-code ;; + "format" ) + say "Formatting $files" + ocamlformat --inplace $files ;; + "help" | "-help" | "--help" | "-h" ) + usage ;; + * ) + say "Error no action (arg 1 = '$action') provided" + usage + exit 2 + ;; +esac + + diff --git a/src/tooling/tezos-tooling.opam b/src/tooling/tezos-tooling.opam index 20e498c4691b..3d12535ddc1c 100644 --- a/src/tooling/tezos-tooling.opam +++ b/src/tooling/tezos-tooling.opam @@ -7,7 +7,7 @@ dev-repo: "git+https://gitlab.com/tezos/tezos.git" license: "MIT" depends: [ "dune" { build & >= "1.7" } - "ocp-indent" { = "1.6.1" } + "ocamlformat" { = "0.10" } ] build: [ ["dune" "build" "-p" name "-j" jobs] -- GitLab From 092341249fdd1456df8e746b5b01c172d78de8d0 Mon Sep 17 00:00:00 2001 From: Sebastien Mondet Date: Mon, 12 Aug 2019 12:57:04 -0400 Subject: [PATCH 2/5] CI: set opam-repo docker tag --- .gitlab-ci.yml | 2 +- scripts/version.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6e428b939ee9..917138637575 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ variables: ## Please update `scripts/version.sh` accordingly - build_deps_image_version: b98d1114e1bafbe50f017e619cbfcede77df0149 + build_deps_image_version: 0965ca9934ba0f86a18637984d23e4c0e8dc0100 build_deps_image_name: registry.gitlab.com/tezos/opam-repository public_docker_image_name: docker.io/${CI_PROJECT_PATH} GIT_STRATEGY: fetch diff --git a/scripts/version.sh b/scripts/version.sh index a40e7c63ee86..6e1db2245365 100644 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -7,7 +7,7 @@ ocaml_version=4.07.1 opam_version=2.0 ## Please update `.gitlab-ci.yml` accordingly -opam_repository_tag=b98d1114e1bafbe50f017e619cbfcede77df0149 +opam_repository_tag=0965ca9934ba0f86a18637984d23e4c0e8dc0100 full_opam_repository_tag=4c2bd0f948ae6a0fc602f73631cc8a8ae6e83c1d opam_repository_url=https://gitlab.com/tezos/opam-repository.git opam_repository=$opam_repository_url\#$opam_repository_tag -- GitLab From c98e065e243442eca45ba7e97541771e6723ce99 Mon Sep 17 00:00:00 2001 From: Sebastien Mondet Date: Fri, 26 Jul 2019 16:51:57 -0400 Subject: [PATCH 3/5] =?UTF-8?q?Rename=20`get-git-info.ml`=20=E2=86=92=20`g?= =?UTF-8?q?et-git-info.mlt`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib_base/dune | 3 +-- src/lib_base/{get-git-info.ml => get-git-info.mlt} | 0 2 files changed, 1 insertion(+), 2 deletions(-) rename src/lib_base/{get-git-info.ml => get-git-info.mlt} (100%) diff --git a/src/lib_base/dune b/src/lib_base/dune index 5be8f97c500b..2c18c4829cfd 100644 --- a/src/lib_base/dune +++ b/src/lib_base/dune @@ -1,7 +1,6 @@ (library (name tezos_base) (public_name tezos-base) - (modules :standard \ Get-git-info) (flags (:standard -w -30 -open Tezos_stdlib -open Tezos_crypto @@ -28,7 +27,7 @@ (rule (targets generated_git_info.ml) - (deps get-git-info.ml) + (deps get-git-info.mlt) (action (with-stdout-to %{targets} (run %{ocaml} unix.cma %{deps})))) (alias diff --git a/src/lib_base/get-git-info.ml b/src/lib_base/get-git-info.mlt similarity index 100% rename from src/lib_base/get-git-info.ml rename to src/lib_base/get-git-info.mlt -- GitLab From 7c2f419aac587598fa2af3cd8f395470e03df0ba Mon Sep 17 00:00:00 2001 From: Sebastien Mondet Date: Fri, 30 Aug 2019 11:28:08 -0400 Subject: [PATCH 4/5] Update .ocamlformat files --- docs/doc_gen/.ocamlformat | 11 ++ docs/doc_gen/errors/.ocamlformat | 11 ++ src/bin_attacker/.ocamlformat | 11 ++ src/bin_client/.ocamlformat | 11 ++ .../test/proto_test_injection/.ocamlformat | 11 ++ src/bin_codec/.ocamlformat | 11 ++ src/bin_flextesa/.ocamlformat | 12 +- src/bin_node/.ocamlformat | 11 ++ src/bin_signer/.ocamlformat | 11 ++ src/lib_base/.ocamlformat | 11 ++ src/lib_clic/.ocamlformat | 11 ++ src/lib_client_base/.ocamlformat | 11 ++ src/lib_client_base_unix/.ocamlformat | 11 ++ src/lib_client_commands/.ocamlformat | 11 ++ src/lib_crypto/.ocamlformat | 11 ++ src/lib_crypto/test/.ocamlformat | 11 ++ src/lib_data_encoding/.ocamlformat | 11 ++ src/lib_data_encoding/test/.ocamlformat | 11 ++ src/lib_error_monad/.ocamlformat | 11 ++ src/lib_error_monad/test/.ocamlformat | 11 ++ src/lib_event_logging/.ocamlformat | 11 ++ src/lib_micheline/.ocamlformat | 11 ++ src/lib_micheline/test/.ocamlformat | 11 ++ src/lib_network_sandbox/.ocamlformat | 12 +- src/lib_p2p/.ocamlformat | 11 ++ src/lib_p2p/test/.ocamlformat | 11 ++ src/lib_protocol_compiler/.ocamlformat | 11 ++ src/lib_protocol_environment/.ocamlformat | 11 ++ .../sigs/v1/.ocamlformat | 11 ++ .../sigs_packer/.ocamlformat | 11 ++ .../test/.ocamlformat | 11 ++ src/lib_protocol_updater/.ocamlformat | 11 ++ src/lib_rpc/.ocamlformat | 11 ++ src/lib_rpc_http/.ocamlformat | 11 ++ src/lib_shell/.ocamlformat | 11 ++ src/lib_shell/bench/.ocamlformat | 11 ++ src/lib_shell/test/.ocamlformat | 11 ++ src/lib_shell_services/.ocamlformat | 11 ++ src/lib_signer_backends/.ocamlformat | 11 ++ src/lib_signer_backends/test/.ocamlformat | 11 ++ src/lib_signer_backends/unix/.ocamlformat | 11 ++ .../unix/test/.ocamlformat | 11 ++ src/lib_signer_services/.ocamlformat | 11 ++ src/lib_stdlib/.ocamlformat | 11 ++ src/lib_stdlib/test/.ocamlformat | 11 ++ src/lib_stdlib_unix/.ocamlformat | 11 ++ src/lib_storage/.ocamlformat | 11 ++ src/lib_storage/test/.ocamlformat | 11 ++ src/lib_validation/.ocamlformat | 11 ++ src/ligo/parser/camligo/.ocamlformat | 11 ++ src/ligo/parser/pascaligo/.ocamlformat | 11 ++ src/proto_alpha/bin_accuser/.ocamlformat | 11 ++ src/proto_alpha/bin_baker/.ocamlformat | 11 ++ src/proto_alpha/bin_endorser/.ocamlformat | 11 ++ src/proto_alpha/lib_client/.ocamlformat | 11 ++ src/proto_alpha/lib_client/test/.ocamlformat | 11 ++ .../lib_client_commands/.ocamlformat | 11 ++ src/proto_alpha/lib_delegate/.ocamlformat | 11 ++ src/proto_alpha/lib_mempool/.ocamlformat | 11 ++ src/proto_alpha/lib_parameters/.ocamlformat | 11 ++ src/proto_alpha/lib_protocol/.ocamlformat | 11 ++ .../lib_protocol/.ocamlformat-ignore | 120 ++++++++++++++++++ .../lib_protocol/test/.ocamlformat | 11 ++ .../lib_protocol/test/helpers/.ocamlformat | 11 ++ .../lib_protocol/.ocamlformat | 11 ++ src/proto_genesis/lib_client/.ocamlformat | 11 ++ src/proto_genesis/lib_protocol/.ocamlformat | 11 ++ .../lib_protocol/.ocamlformat-ignore | 4 + 68 files changed, 850 insertions(+), 2 deletions(-) create mode 100644 docs/doc_gen/.ocamlformat create mode 100644 docs/doc_gen/errors/.ocamlformat create mode 100644 src/bin_attacker/.ocamlformat create mode 100644 src/bin_client/.ocamlformat create mode 100644 src/bin_client/test/proto_test_injection/.ocamlformat create mode 100644 src/bin_codec/.ocamlformat create mode 100644 src/bin_node/.ocamlformat create mode 100644 src/bin_signer/.ocamlformat create mode 100644 src/lib_base/.ocamlformat create mode 100644 src/lib_clic/.ocamlformat create mode 100644 src/lib_client_base/.ocamlformat create mode 100644 src/lib_client_base_unix/.ocamlformat create mode 100644 src/lib_client_commands/.ocamlformat create mode 100644 src/lib_crypto/.ocamlformat create mode 100644 src/lib_crypto/test/.ocamlformat create mode 100644 src/lib_data_encoding/.ocamlformat create mode 100644 src/lib_data_encoding/test/.ocamlformat create mode 100644 src/lib_error_monad/.ocamlformat create mode 100644 src/lib_error_monad/test/.ocamlformat create mode 100644 src/lib_event_logging/.ocamlformat create mode 100644 src/lib_micheline/.ocamlformat create mode 100644 src/lib_micheline/test/.ocamlformat create mode 100644 src/lib_p2p/.ocamlformat create mode 100644 src/lib_p2p/test/.ocamlformat create mode 100644 src/lib_protocol_compiler/.ocamlformat create mode 100644 src/lib_protocol_environment/.ocamlformat create mode 100644 src/lib_protocol_environment/sigs/v1/.ocamlformat create mode 100644 src/lib_protocol_environment/sigs_packer/.ocamlformat create mode 100644 src/lib_protocol_environment/test/.ocamlformat create mode 100644 src/lib_protocol_updater/.ocamlformat create mode 100644 src/lib_rpc/.ocamlformat create mode 100644 src/lib_rpc_http/.ocamlformat create mode 100644 src/lib_shell/.ocamlformat create mode 100644 src/lib_shell/bench/.ocamlformat create mode 100644 src/lib_shell/test/.ocamlformat create mode 100644 src/lib_shell_services/.ocamlformat create mode 100644 src/lib_signer_backends/.ocamlformat create mode 100644 src/lib_signer_backends/test/.ocamlformat create mode 100644 src/lib_signer_backends/unix/.ocamlformat create mode 100644 src/lib_signer_backends/unix/test/.ocamlformat create mode 100644 src/lib_signer_services/.ocamlformat create mode 100644 src/lib_stdlib/.ocamlformat create mode 100644 src/lib_stdlib/test/.ocamlformat create mode 100644 src/lib_stdlib_unix/.ocamlformat create mode 100644 src/lib_storage/.ocamlformat create mode 100644 src/lib_storage/test/.ocamlformat create mode 100644 src/lib_validation/.ocamlformat create mode 100644 src/ligo/parser/camligo/.ocamlformat create mode 100644 src/ligo/parser/pascaligo/.ocamlformat create mode 100644 src/proto_alpha/bin_accuser/.ocamlformat create mode 100644 src/proto_alpha/bin_baker/.ocamlformat create mode 100644 src/proto_alpha/bin_endorser/.ocamlformat create mode 100644 src/proto_alpha/lib_client/.ocamlformat create mode 100644 src/proto_alpha/lib_client/test/.ocamlformat create mode 100644 src/proto_alpha/lib_client_commands/.ocamlformat create mode 100644 src/proto_alpha/lib_delegate/.ocamlformat create mode 100644 src/proto_alpha/lib_mempool/.ocamlformat create mode 100644 src/proto_alpha/lib_parameters/.ocamlformat create mode 100644 src/proto_alpha/lib_protocol/.ocamlformat create mode 100644 src/proto_alpha/lib_protocol/.ocamlformat-ignore create mode 100644 src/proto_alpha/lib_protocol/test/.ocamlformat create mode 100644 src/proto_alpha/lib_protocol/test/helpers/.ocamlformat create mode 100644 src/proto_demo_noops/lib_protocol/.ocamlformat create mode 100644 src/proto_genesis/lib_client/.ocamlformat create mode 100644 src/proto_genesis/lib_protocol/.ocamlformat create mode 100644 src/proto_genesis/lib_protocol/.ocamlformat-ignore diff --git a/docs/doc_gen/.ocamlformat b/docs/doc_gen/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/docs/doc_gen/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/docs/doc_gen/errors/.ocamlformat b/docs/doc_gen/errors/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/docs/doc_gen/errors/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/bin_attacker/.ocamlformat b/src/bin_attacker/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/bin_attacker/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/bin_client/.ocamlformat b/src/bin_client/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/bin_client/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/bin_client/test/proto_test_injection/.ocamlformat b/src/bin_client/test/proto_test_injection/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/bin_client/test/proto_test_injection/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/bin_codec/.ocamlformat b/src/bin_codec/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/bin_codec/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/bin_flextesa/.ocamlformat b/src/bin_flextesa/.ocamlformat index a3d97274f48f..9d2a5a5f36ac 100644 --- a/src/bin_flextesa/.ocamlformat +++ b/src/bin_flextesa/.ocamlformat @@ -1 +1,11 @@ -profile=compact \ No newline at end of file +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 diff --git a/src/bin_node/.ocamlformat b/src/bin_node/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/bin_node/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/bin_signer/.ocamlformat b/src/bin_signer/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/bin_signer/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_base/.ocamlformat b/src/lib_base/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_base/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_clic/.ocamlformat b/src/lib_clic/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_clic/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_client_base/.ocamlformat b/src/lib_client_base/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_client_base/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_client_base_unix/.ocamlformat b/src/lib_client_base_unix/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_client_base_unix/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_client_commands/.ocamlformat b/src/lib_client_commands/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_client_commands/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_crypto/.ocamlformat b/src/lib_crypto/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_crypto/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_crypto/test/.ocamlformat b/src/lib_crypto/test/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_crypto/test/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_data_encoding/.ocamlformat b/src/lib_data_encoding/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_data_encoding/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_data_encoding/test/.ocamlformat b/src/lib_data_encoding/test/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_data_encoding/test/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_error_monad/.ocamlformat b/src/lib_error_monad/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_error_monad/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_error_monad/test/.ocamlformat b/src/lib_error_monad/test/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_error_monad/test/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_event_logging/.ocamlformat b/src/lib_event_logging/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_event_logging/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_micheline/.ocamlformat b/src/lib_micheline/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_micheline/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_micheline/test/.ocamlformat b/src/lib_micheline/test/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_micheline/test/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_network_sandbox/.ocamlformat b/src/lib_network_sandbox/.ocamlformat index a3d97274f48f..9d2a5a5f36ac 100644 --- a/src/lib_network_sandbox/.ocamlformat +++ b/src/lib_network_sandbox/.ocamlformat @@ -1 +1,11 @@ -profile=compact \ No newline at end of file +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 diff --git a/src/lib_p2p/.ocamlformat b/src/lib_p2p/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_p2p/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_p2p/test/.ocamlformat b/src/lib_p2p/test/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_p2p/test/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_protocol_compiler/.ocamlformat b/src/lib_protocol_compiler/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_protocol_compiler/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_protocol_environment/.ocamlformat b/src/lib_protocol_environment/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_protocol_environment/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_protocol_environment/sigs/v1/.ocamlformat b/src/lib_protocol_environment/sigs/v1/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_protocol_environment/sigs/v1/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_protocol_environment/sigs_packer/.ocamlformat b/src/lib_protocol_environment/sigs_packer/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_protocol_environment/sigs_packer/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_protocol_environment/test/.ocamlformat b/src/lib_protocol_environment/test/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_protocol_environment/test/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_protocol_updater/.ocamlformat b/src/lib_protocol_updater/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_protocol_updater/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_rpc/.ocamlformat b/src/lib_rpc/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_rpc/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_rpc_http/.ocamlformat b/src/lib_rpc_http/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_rpc_http/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_shell/.ocamlformat b/src/lib_shell/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_shell/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_shell/bench/.ocamlformat b/src/lib_shell/bench/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_shell/bench/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_shell/test/.ocamlformat b/src/lib_shell/test/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_shell/test/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_shell_services/.ocamlformat b/src/lib_shell_services/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_shell_services/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_signer_backends/.ocamlformat b/src/lib_signer_backends/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_signer_backends/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_signer_backends/test/.ocamlformat b/src/lib_signer_backends/test/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_signer_backends/test/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_signer_backends/unix/.ocamlformat b/src/lib_signer_backends/unix/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_signer_backends/unix/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_signer_backends/unix/test/.ocamlformat b/src/lib_signer_backends/unix/test/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_signer_backends/unix/test/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_signer_services/.ocamlformat b/src/lib_signer_services/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_signer_services/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_stdlib/.ocamlformat b/src/lib_stdlib/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_stdlib/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_stdlib/test/.ocamlformat b/src/lib_stdlib/test/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_stdlib/test/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_stdlib_unix/.ocamlformat b/src/lib_stdlib_unix/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_stdlib_unix/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_storage/.ocamlformat b/src/lib_storage/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_storage/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_storage/test/.ocamlformat b/src/lib_storage/test/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_storage/test/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/lib_validation/.ocamlformat b/src/lib_validation/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/lib_validation/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/ligo/parser/camligo/.ocamlformat b/src/ligo/parser/camligo/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/ligo/parser/camligo/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/ligo/parser/pascaligo/.ocamlformat b/src/ligo/parser/pascaligo/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/ligo/parser/pascaligo/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_alpha/bin_accuser/.ocamlformat b/src/proto_alpha/bin_accuser/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/proto_alpha/bin_accuser/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_alpha/bin_baker/.ocamlformat b/src/proto_alpha/bin_baker/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/proto_alpha/bin_baker/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_alpha/bin_endorser/.ocamlformat b/src/proto_alpha/bin_endorser/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/proto_alpha/bin_endorser/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_alpha/lib_client/.ocamlformat b/src/proto_alpha/lib_client/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/proto_alpha/lib_client/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_alpha/lib_client/test/.ocamlformat b/src/proto_alpha/lib_client/test/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/proto_alpha/lib_client/test/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_alpha/lib_client_commands/.ocamlformat b/src/proto_alpha/lib_client_commands/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/proto_alpha/lib_client_commands/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_alpha/lib_delegate/.ocamlformat b/src/proto_alpha/lib_delegate/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/proto_alpha/lib_delegate/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_alpha/lib_mempool/.ocamlformat b/src/proto_alpha/lib_mempool/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/proto_alpha/lib_mempool/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_alpha/lib_parameters/.ocamlformat b/src/proto_alpha/lib_parameters/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/proto_alpha/lib_parameters/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_alpha/lib_protocol/.ocamlformat b/src/proto_alpha/lib_protocol/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/proto_alpha/lib_protocol/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_alpha/lib_protocol/.ocamlformat-ignore b/src/proto_alpha/lib_protocol/.ocamlformat-ignore new file mode 100644 index 000000000000..638f36536584 --- /dev/null +++ b/src/proto_alpha/lib_protocol/.ocamlformat-ignore @@ -0,0 +1,120 @@ +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 +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_interpreter.ml +script_interpreter.mli +script_int_repr.ml +script_int_repr.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_description.ml +storage_description.mli +storage_functors.ml +storage_functors.mli +storage.ml +storage.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 diff --git a/src/proto_alpha/lib_protocol/test/.ocamlformat b/src/proto_alpha/lib_protocol/test/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/proto_alpha/lib_protocol/test/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_alpha/lib_protocol/test/helpers/.ocamlformat b/src/proto_alpha/lib_protocol/test/helpers/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/proto_alpha/lib_protocol/test/helpers/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_demo_noops/lib_protocol/.ocamlformat b/src/proto_demo_noops/lib_protocol/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/proto_demo_noops/lib_protocol/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_genesis/lib_client/.ocamlformat b/src/proto_genesis/lib_client/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/proto_genesis/lib_client/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_genesis/lib_protocol/.ocamlformat b/src/proto_genesis/lib_protocol/.ocamlformat new file mode 100644 index 000000000000..9d2a5a5f36ac --- /dev/null +++ b/src/proto_genesis/lib_protocol/.ocamlformat @@ -0,0 +1,11 @@ +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 diff --git a/src/proto_genesis/lib_protocol/.ocamlformat-ignore b/src/proto_genesis/lib_protocol/.ocamlformat-ignore new file mode 100644 index 000000000000..0ff7b97edc7e --- /dev/null +++ b/src/proto_genesis/lib_protocol/.ocamlformat-ignore @@ -0,0 +1,4 @@ +data.ml +main.ml +main.mli +services.ml -- GitLab From 3e93bcdc61a82e96cd53417f05f48322965889e1 Mon Sep 17 00:00:00 2001 From: Sebastien Mondet Date: Fri, 30 Aug 2019 11:29:03 -0400 Subject: [PATCH 5/5] Run `make fmt` #WhiteSpace --- docs/doc_gen/errors/error_doc.ml | 276 +- docs/doc_gen/node_helpers.ml | 50 +- docs/doc_gen/p2p_doc.ml | 51 +- docs/doc_gen/rpc_doc.ml | 357 ++- docs/doc_gen/rst.ml | 21 +- src/bin_attacker/attacker_minimal.ml | 387 ++- src/bin_attacker/attacker_minimal.mli | 2 +- src/bin_client/client_protocols_commands.ml | 146 +- src/bin_client/client_protocols_commands.mli | 2 +- src/bin_client/client_rpc_commands.ml | 775 ++--- src/bin_client/client_rpc_commands.mli | 2 +- src/bin_client/main_admin.ml | 18 +- src/bin_client/main_client.ml | 142 +- .../test/proto_test_injection/main.ml | 115 +- src/bin_codec/codec.ml | 147 +- src/bin_codec/commands.ml | 347 +- src/bin_flextesa/command_accusations.ml | 511 ++- .../command_daemons_protocol_change.ml | 545 ++-- src/bin_flextesa/command_ledger_baking.ml | 313 +- src/bin_flextesa/command_ledger_wallet.ml | 235 +- src/bin_flextesa/command_mini_network.ml | 152 +- src/bin_flextesa/command_prevalidation.ml | 6 +- src/bin_flextesa/command_voting.ml | 734 +++-- src/bin_flextesa/main.ml | 72 +- src/bin_node/genesis_chain.ml | 20 +- src/bin_node/main.ml | 62 +- src/bin_node/node_config_command.ml | 175 +- src/bin_node/node_config_command.mli | 2 +- src/bin_node/node_config_file.ml | 1368 ++++---- src/bin_node/node_config_file.mli | 97 +- src/bin_node/node_data_version.ml | 206 +- src/bin_node/node_data_version.mli | 13 +- src/bin_node/node_identity_command.ml | 212 +- src/bin_node/node_identity_command.mli | 4 +- src/bin_node/node_identity_file.ml | 167 +- src/bin_node/node_identity_file.mli | 9 +- src/bin_node/node_logging.ml | 6 +- src/bin_node/node_run_command.ml | 589 ++-- src/bin_node/node_run_command.mli | 7 +- src/bin_node/node_shared_arg.ml | 525 +-- src/bin_node/node_shared_arg.mli | 70 +- src/bin_node/node_snapshot_command.ml | 149 +- src/bin_node/node_snapshot_command.mli | 3 +- src/bin_node/patch_context.ml | 45 +- src/bin_node/patch_context.mli | 4 +- src/bin_signer/handler.ml | 375 ++- src/bin_signer/handler.mli | 39 +- src/bin_signer/http_daemon.ml | 132 +- src/bin_signer/http_daemon.mli | 24 +- src/bin_signer/main_signer.ml | 461 +-- src/bin_signer/signer_logging.ml | 13 +- src/bin_signer/signer_logging.mli | 17 +- src/bin_signer/socket_daemon.ml | 143 +- src/bin_signer/socket_daemon.mli | 8 +- src/lib_base/base_logging.ml | 20 +- src/lib_base/base_logging.mli | 1 + src/lib_base/block_header.ml | 198 +- src/lib_base/block_header.mli | 54 +- src/lib_base/block_locator.ml | 200 +- src/lib_base/block_locator.mli | 63 +- src/lib_base/current_git_info.ml | 13 +- src/lib_base/current_git_info.mli | 2 + src/lib_base/distributed_db_version.ml | 5 +- src/lib_base/distributed_db_version.mli | 17 +- src/lib_base/fitness.ml | 90 +- src/lib_base/get-git-info.mlt | 20 +- src/lib_base/lwt_exit.ml | 146 +- src/lib_base/lwt_exit.mli | 9 +- src/lib_base/mempool.ml | 40 +- src/lib_base/mempool.mli | 15 +- src/lib_base/network_version.ml | 100 +- src/lib_base/network_version.mli | 30 +- src/lib_base/operation.ml | 91 +- src/lib_base/operation.mli | 39 +- src/lib_base/p2p_addr.ml | 38 +- src/lib_base/p2p_addr.mli | 2 + src/lib_base/p2p_connection.ml | 576 ++-- src/lib_base/p2p_connection.mli | 91 +- src/lib_base/p2p_identity.ml | 58 +- src/lib_base/p2p_identity.mli | 15 +- src/lib_base/p2p_peer.ml | 264 +- src/lib_base/p2p_peer.mli | 76 +- src/lib_base/p2p_peer_id.ml | 26 +- src/lib_base/p2p_peer_id.mli | 11 +- src/lib_base/p2p_point.ml | 543 ++-- src/lib_base/p2p_point.mli | 68 +- src/lib_base/p2p_stat.ml | 84 +- src/lib_base/p2p_stat.mli | 10 +- src/lib_base/p2p_version.ml | 10 +- src/lib_base/p2p_version.mli | 9 +- src/lib_base/preapply_result.ml | 72 +- src/lib_base/preapply_result.mli | 20 +- src/lib_base/protocol.ml | 116 +- src/lib_base/protocol.mli | 36 +- src/lib_base/s.ml | 192 +- src/lib_base/test_chain_status.ml | 126 +- src/lib_base/test_chain_status.mli | 15 +- src/lib_base/time.ml | 302 +- src/lib_base/time.mli | 59 +- src/lib_base/tzPervasives.ml | 9 +- src/lib_base/tzPervasives.mli | 55 +- src/lib_clic/clic.ml | 2819 +++++++++++------ src/lib_clic/clic.mli | 320 +- src/lib_clic/scriptable.ml | 50 +- src/lib_clic/scriptable.mli | 24 +- src/lib_client_base/client_aliases.ml | 340 +- src/lib_client_base/client_aliases.mli | 85 +- src/lib_client_base/client_confirmations.ml | 307 +- src/lib_client_base/client_confirmations.mli | 7 +- src/lib_client_base/client_context.ml | 270 +- src/lib_client_base/client_context.mli | 164 +- src/lib_client_base/client_keys.ml | 478 +-- src/lib_client_base/client_keys.mli | 123 +- src/lib_client_base_unix/client_config.ml | 684 ++-- .../client_context_unix.ml | 226 +- .../client_context_unix.mli | 32 +- src/lib_client_base_unix/client_main_run.ml | 479 +-- src/lib_client_base_unix/client_main_run.mli | 30 +- .../client_admin_commands.ml | 108 +- src/lib_client_commands/client_commands.ml | 15 +- src/lib_client_commands/client_commands.mli | 12 +- .../client_event_logging_commands.ml | 398 +-- .../client_event_logging_commands.mli | 2 +- .../client_helpers_commands.ml | 83 +- .../client_helpers_commands.mli | 2 +- .../client_keys_commands.ml | 904 +++--- .../client_keys_commands.mli | 2 +- .../client_p2p_commands.ml | 444 +-- .../client_p2p_commands.mli | 2 +- .../client_report_commands.ml | 86 +- .../client_report_commands.mli | 1 - src/lib_crypto/base58.ml | 346 +- src/lib_crypto/base58.mli | 175 +- src/lib_crypto/blake2B.ml | 387 +-- src/lib_crypto/blake2B.mli | 83 +- src/lib_crypto/block_hash.ml | 23 +- src/lib_crypto/block_hash.mli | 1 + src/lib_crypto/chain_id.ml | 112 +- src/lib_crypto/chain_id.mli | 2 +- src/lib_crypto/context_hash.ml | 20 +- src/lib_crypto/crypto_box.ml | 132 +- src/lib_crypto/crypto_box.mli | 27 +- src/lib_crypto/ed25519.ml | 407 +-- src/lib_crypto/ed25519.mli | 1 + src/lib_crypto/helpers.ml | 314 +- src/lib_crypto/operation_hash.ml | 20 +- src/lib_crypto/operation_list_hash.ml | 21 +- src/lib_crypto/operation_list_hash.mli | 1 - src/lib_crypto/operation_list_list_hash.ml | 21 +- src/lib_crypto/p256.ml | 362 ++- src/lib_crypto/p256.mli | 1 + src/lib_crypto/protocol_hash.ml | 20 +- src/lib_crypto/pvss.ml | 300 +- src/lib_crypto/pvss.mli | 78 +- src/lib_crypto/pvss_secp256k1.ml | 26 +- src/lib_crypto/rand.ml | 13 +- src/lib_crypto/rand.mli | 4 +- src/lib_crypto/s.ml | 202 +- src/lib_crypto/secp256k1.ml | 366 ++- src/lib_crypto/secp256k1.mli | 1 + src/lib_crypto/secp256k1_group.ml | 308 +- src/lib_crypto/secp256k1_group.mli | 63 +- src/lib_crypto/signature.ml | 907 +++--- src/lib_crypto/signature.mli | 30 +- src/lib_crypto/test/roundtrips.ml | 32 +- src/lib_crypto/test/test_base58.ml | 74 +- src/lib_crypto/test/test_blake2b.ml | 44 +- .../test/test_deterministic_nonce.ml | 22 +- src/lib_crypto/test/test_ed25519.ml | 62 +- src/lib_crypto/test/test_merkle.ml | 83 +- src/lib_crypto/test/test_pvss.ml | 189 +- src/lib_crypto/znz.ml | 139 +- src/lib_crypto/znz.mli | 38 +- src/lib_crypto/zplus.ml | 40 +- src/lib_crypto/zplus.mli | 27 +- src/lib_data_encoding/binary_description.ml | 938 +++--- src/lib_data_encoding/binary_description.mli | 2 +- src/lib_data_encoding/binary_error.ml | 36 +- src/lib_data_encoding/binary_error.mli | 16 +- src/lib_data_encoding/binary_length.ml | 257 +- src/lib_data_encoding/binary_length.mli | 3 + src/lib_data_encoding/binary_reader.ml | 491 +-- src/lib_data_encoding/binary_reader.mli | 8 +- src/lib_data_encoding/binary_schema.ml | 840 ++--- src/lib_data_encoding/binary_schema.mli | 28 +- src/lib_data_encoding/binary_size.ml | 93 +- src/lib_data_encoding/binary_size.mli | 64 +- src/lib_data_encoding/binary_stream.ml | 74 +- src/lib_data_encoding/binary_stream.mli | 20 +- src/lib_data_encoding/binary_stream_reader.ml | 652 ++-- .../binary_stream_reader.mli | 4 +- src/lib_data_encoding/binary_writer.ml | 409 +-- src/lib_data_encoding/binary_writer.mli | 2 + src/lib_data_encoding/bson.ml | 2 + src/lib_data_encoding/bson.mli | 3 + src/lib_data_encoding/data_encoding.ml | 129 +- src/lib_data_encoding/data_encoding.mli | 333 +- src/lib_data_encoding/encoding.ml | 1009 +++--- src/lib_data_encoding/encoding.mli | 424 ++- src/lib_data_encoding/json.ml | 527 +-- src/lib_data_encoding/json.mli | 37 +- src/lib_data_encoding/registration.ml | 92 +- src/lib_data_encoding/registration.mli | 14 +- .../test/bench_data_encoding.ml | 154 +- src/lib_data_encoding/test/helpers.ml | 61 +- .../test/invalid_encoding.ml | 32 +- src/lib_data_encoding/test/randomized.ml | 38 +- src/lib_data_encoding/test/read_failure.ml | 321 +- src/lib_data_encoding/test/success.ml | 439 +-- src/lib_data_encoding/test/test.ml | 16 +- src/lib_data_encoding/test/test_generated.ml | 988 ++++-- src/lib_data_encoding/test/types.ml | 254 +- src/lib_data_encoding/test/versioned.ml | 214 +- src/lib_data_encoding/test/write_failure.ml | 92 +- src/lib_data_encoding/with_version.ml | 64 +- src/lib_data_encoding/with_version.mli | 2 +- src/lib_error_monad/error_monad.ml | 883 +++--- src/lib_error_monad/error_monad.mli | 49 +- src/lib_error_monad/error_monad_sig.ml | 117 +- src/lib_error_monad/error_table.ml | 120 +- src/lib_error_monad/error_table.mli | 33 +- src/lib_error_monad/test/assert.ml | 6 +- src/lib_error_monad/test/test_error_tables.ml | 204 +- src/lib_event_logging/internal_event.ml | 622 ++-- src/lib_event_logging/internal_event.mli | 247 +- src/lib_micheline/micheline.ml | 310 +- src/lib_micheline/micheline.mli | 37 +- src/lib_micheline/micheline_parser.ml | 1251 ++++---- src/lib_micheline/micheline_parser.mli | 33 +- src/lib_micheline/micheline_printer.ml | 212 +- src/lib_micheline/micheline_printer.mli | 12 +- src/lib_micheline/test/assert.ml | 129 +- src/lib_micheline/test/test_parser.ml | 922 ++++-- src/lib_network_sandbox/console.ml | 177 +- src/lib_network_sandbox/console.mli | 96 +- src/lib_network_sandbox/helpers.ml | 81 +- src/lib_network_sandbox/helpers.mli | 84 +- src/lib_network_sandbox/interactive_test.ml | 389 ++- src/lib_network_sandbox/interactive_test.mli | 258 +- .../internal_pervasives.ml | 228 +- src/lib_network_sandbox/kiln.ml | 76 +- src/lib_network_sandbox/kiln.mli | 30 +- src/lib_network_sandbox/log_recorder.ml | 47 +- src/lib_network_sandbox/paths.ml | 9 +- src/lib_network_sandbox/paths.mli | 3 +- src/lib_network_sandbox/running_processes.ml | 147 +- src/lib_network_sandbox/running_processes.mli | 123 +- src/lib_network_sandbox/test_command_line.ml | 5 +- src/lib_network_sandbox/test_command_line.mli | 38 +- src/lib_network_sandbox/test_scenario.ml | 199 +- src/lib_network_sandbox/test_scenario.mli | 171 +- src/lib_network_sandbox/tezos_admin_client.ml | 30 +- .../tezos_admin_client.mli | 53 +- src/lib_network_sandbox/tezos_client.ml | 308 +- src/lib_network_sandbox/tezos_client.mli | 420 +-- src/lib_network_sandbox/tezos_daemon.ml | 78 +- src/lib_network_sandbox/tezos_daemon.mli | 66 +- src/lib_network_sandbox/tezos_executable.ml | 73 +- src/lib_network_sandbox/tezos_executable.mli | 38 +- src/lib_network_sandbox/tezos_node.ml | 106 +- src/lib_network_sandbox/tezos_node.mli | 69 +- src/lib_network_sandbox/tezos_protocol.ml | 291 +- src/lib_network_sandbox/tezos_protocol.mli | 94 +- src/lib_p2p/p2p.ml | 734 +++-- src/lib_p2p/p2p.mli | 206 +- src/lib_p2p/p2p_acl.ml | 153 +- src/lib_p2p/p2p_acl.mli | 41 +- src/lib_p2p/p2p_answerer.ml | 84 +- src/lib_p2p/p2p_answerer.mli | 17 +- src/lib_p2p/p2p_discovery.ml | 302 +- src/lib_p2p/p2p_discovery.mli | 7 +- src/lib_p2p/p2p_errors.ml | 134 +- src/lib_p2p/p2p_errors.mli | 20 +- src/lib_p2p/p2p_fd.ml | 61 +- src/lib_p2p/p2p_fd.mli | 6 + src/lib_p2p/p2p_io_scheduler.ml | 614 ++-- src/lib_p2p/p2p_io_scheduler.mli | 60 +- src/lib_p2p/p2p_maintenance.ml | 288 +- src/lib_p2p/p2p_maintenance.mli | 41 +- src/lib_p2p/p2p_message.ml | 123 +- src/lib_p2p/p2p_message.mli | 33 +- src/lib_p2p/p2p_peer_state.ml | 253 +- src/lib_p2p/p2p_peer_state.mli | 104 +- src/lib_p2p/p2p_point_state.ml | 300 +- src/lib_p2p/p2p_point_state.mli | 79 +- src/lib_p2p/p2p_pool.ml | 1548 +++++---- src/lib_p2p/p2p_pool.mli | 381 +-- src/lib_p2p/p2p_socket.ml | 759 +++-- src/lib_p2p/p2p_socket.mli | 83 +- src/lib_p2p/p2p_welcome.ml | 154 +- src/lib_p2p/p2p_welcome.mli | 15 +- src/lib_p2p/test/process.ml | 189 +- src/lib_p2p/test/process.mli | 14 +- src/lib_p2p/test/test_p2p_banned_peers.ml | 84 +- src/lib_p2p/test/test_p2p_io_scheduler.ml | 307 +- src/lib_p2p/test/test_p2p_ipv6set.ml | 164 +- src/lib_p2p/test/test_p2p_peerset.ml | 69 +- src/lib_p2p/test/test_p2p_pool.ml | 484 +-- src/lib_p2p/test/test_p2p_socket.ml | 546 ++-- src/lib_protocol_compiler/byte.ml | 16 +- src/lib_protocol_compiler/byte.mli | 2 +- src/lib_protocol_compiler/compiler.ml | 208 +- src/lib_protocol_compiler/embedded_cmis.mli | 11 +- src/lib_protocol_compiler/main_byte.ml | 2 +- .../main_embedded_packer.ml | 28 +- src/lib_protocol_compiler/main_native.ml | 2 +- src/lib_protocol_compiler/main_packer.ml | 36 +- src/lib_protocol_compiler/native.ml | 20 +- src/lib_protocol_compiler/native.mli | 2 +- src/lib_protocol_compiler/packer.ml | 50 +- src/lib_protocol_compiler/packer.mli | 2 +- src/lib_protocol_compiler/registerer.ml | 12 +- src/lib_protocol_compiler/registerer.mli | 15 +- src/lib_protocol_compiler/replace.ml | 93 +- src/lib_protocol_environment/dummy_context.ml | 14 +- .../memory_context.ml | 128 +- src/lib_protocol_environment/shell_context.ml | 29 +- .../shell_context.mli | 16 +- .../sigs/v1/RPC_answer.mli | 19 +- .../sigs/v1/RPC_arg.mli | 34 +- .../sigs/v1/RPC_context.mli | 143 +- .../sigs/v1/RPC_directory.mli | 158 +- .../sigs/v1/RPC_path.mli | 24 +- .../sigs/v1/RPC_query.mli | 50 +- .../sigs/v1/RPC_service.mli | 59 +- .../sigs/v1/base58.mli | 21 +- .../sigs/v1/blake2B.mli | 25 +- .../sigs/v1/block_header.mli | 30 +- .../sigs/v1/compare.mli | 33 +- .../sigs/v1/context.mli | 34 +- .../sigs/v1/data_encoding.mli | 295 +- .../sigs/v1/error_monad.mli | 68 +- .../sigs/v1/fitness.mli | 3 +- .../sigs/v1/format.mli | 114 +- .../sigs/v1/int32.mli | 82 +- .../sigs/v1/int64.mli | 89 +- src/lib_protocol_environment/sigs/v1/json.mli | 1 + src/lib_protocol_environment/sigs/v1/list.mli | 110 +- .../sigs/v1/logging.mli | 33 +- src/lib_protocol_environment/sigs/v1/lwt.mli | 33 +- .../sigs/v1/lwt_list.mli | 10 +- .../sigs/v1/mBytes.mli | 90 +- src/lib_protocol_environment/sigs/v1/map.mli | 11 +- .../sigs/v1/micheline.mli | 24 +- .../sigs/v1/operation.mli | 15 +- .../sigs/v1/operation_list_hash.mli | 4 +- .../sigs/v1/operation_list_list_hash.mli | 3 +- .../sigs/v1/option.mli | 12 +- .../sigs/v1/pervasives.mli | 137 +- .../sigs/v1/protocol.mli | 19 +- src/lib_protocol_environment/sigs/v1/s.mli | 323 +- src/lib_protocol_environment/sigs/v1/set.mli | 11 +- .../sigs/v1/signature.mli | 8 +- .../sigs/v1/string.mli | 83 +- .../sigs/v1/tezos_data.mli | 4 +- src/lib_protocol_environment/sigs/v1/time.mli | 9 +- .../sigs/v1/updater.mli | 125 +- src/lib_protocol_environment/sigs/v1/z.mli | 56 +- .../sigs_packer/sigs_packer.ml | 30 +- src/lib_protocol_environment/test/assert.ml | 42 +- src/lib_protocol_environment/test/test.ml | 4 +- .../test/test_mem_context.ml | 193 +- .../tezos_protocol_environment.ml | 1026 +++--- .../tezos_protocol_environment.mli | 311 +- .../registered_protocol.ml | 91 +- .../registered_protocol.mli | 47 +- src/lib_protocol_updater/updater.ml | 73 +- src/lib_protocol_updater/updater.mli | 6 +- src/lib_protocol_updater/updater_logging.ml | 4 +- src/lib_rpc/RPC_answer.ml | 10 +- src/lib_rpc/RPC_answer.mli | 20 +- src/lib_rpc/RPC_arg.ml | 1 + src/lib_rpc/RPC_arg.mli | 5 +- src/lib_rpc/RPC_context.ml | 276 +- src/lib_rpc/RPC_context.mli | 149 +- src/lib_rpc/RPC_description.ml | 3 +- src/lib_rpc/RPC_description.mli | 7 +- src/lib_rpc/RPC_directory.ml | 79 +- src/lib_rpc/RPC_directory.mli | 149 +- src/lib_rpc/RPC_encoding.ml | 254 +- src/lib_rpc/RPC_encoding.mli | 6 +- src/lib_rpc/RPC_error.ml | 3 +- src/lib_rpc/RPC_error.mli | 4 +- src/lib_rpc/RPC_path.mli | 4 +- src/lib_rpc/RPC_query.mli | 4 +- src/lib_rpc/RPC_service.ml | 86 +- src/lib_rpc/RPC_service.mli | 100 +- src/lib_rpc_http/RPC_client.ml | 416 ++- src/lib_rpc_http/RPC_client.mli | 81 +- src/lib_rpc_http/RPC_client_errors.ml | 237 +- src/lib_rpc_http/RPC_client_errors.mli | 31 +- src/lib_rpc_http/RPC_client_unix.ml | 90 +- src/lib_rpc_http/RPC_server.ml | 10 +- src/lib_rpc_http/RPC_server.mli | 5 +- src/lib_rpc_http/media_type.ml | 196 +- src/lib_rpc_http/media_type.mli | 14 +- src/lib_shell/bench/bench_simple.ml | 36 +- src/lib_shell/bench/bench_tool.ml | 495 +-- src/lib_shell/block_directory.ml | 728 +++-- src/lib_shell/block_directory.mli | 11 +- src/lib_shell/block_validator.ml | 376 ++- src/lib_shell/block_validator.mli | 44 +- src/lib_shell/block_validator_process.ml | 84 +- src/lib_shell/block_validator_process.mli | 4 +- src/lib_shell/bootstrap_pipeline.ml | 631 ++-- src/lib_shell/bootstrap_pipeline.mli | 17 +- src/lib_shell/chain.ml | 159 +- src/lib_shell/chain.mli | 33 +- src/lib_shell/chain_directory.ml | 218 +- src/lib_shell/chain_directory.mli | 16 +- src/lib_shell/chain_traversal.ml | 159 +- src/lib_shell/chain_traversal.mli | 27 +- src/lib_shell/chain_validator.ml | 858 ++--- src/lib_shell/chain_validator.mli | 63 +- src/lib_shell/distributed_db.ml | 1447 +++++---- src/lib_shell/distributed_db.mli | 145 +- src/lib_shell/distributed_db_functors.ml | 797 +++-- src/lib_shell/distributed_db_functors.mli | 176 +- src/lib_shell/distributed_db_message.ml | 284 +- src/lib_shell/distributed_db_message.mli | 36 +- src/lib_shell/injection_directory.ml | 86 +- src/lib_shell/injection_directory.mli | 2 +- src/lib_shell/mempool_peer_worker.ml | 315 +- src/lib_shell/mempool_peer_worker.mli | 18 +- src/lib_shell/mempool_worker.ml | 601 ++-- src/lib_shell/mempool_worker.mli | 21 +- src/lib_shell/monitor_directory.ml | 347 +- src/lib_shell/monitor_directory.mli | 2 +- src/lib_shell/node.ml | 471 +-- src/lib_shell/node.mli | 60 +- src/lib_shell/p2p_directory.ml | 618 ++-- src/lib_shell/p2p_directory.mli | 2 +- src/lib_shell/peer_validator.ml | 501 +-- src/lib_shell/peer_validator.mli | 58 +- src/lib_shell/prevalidation.ml | 399 +-- src/lib_shell/prevalidation.mli | 37 +- src/lib_shell/prevalidator.ml | 1271 ++++---- src/lib_shell/prevalidator.mli | 52 +- src/lib_shell/protocol_directory.ml | 47 +- src/lib_shell/protocol_directory.mli | 3 +- src/lib_shell/protocol_validator.ml | 247 +- src/lib_shell/protocol_validator.mli | 28 +- src/lib_shell/snapshots.ml | 920 +++--- src/lib_shell/snapshots.mli | 4 +- src/lib_shell/stat_directory.ml | 15 +- src/lib_shell/state.ml | 2400 +++++++------- src/lib_shell/state.mli | 365 ++- src/lib_shell/store.ml | 404 ++- src/lib_shell/store.mli | 222 +- src/lib_shell/test/assert.ml | 128 +- src/lib_shell/test/test.ml | 12 +- src/lib_shell/test/test_locator.ml | 351 +- src/lib_shell/test/test_state.ml | 835 ++--- src/lib_shell/test/test_state_checkpoint.ml | 493 +-- src/lib_shell/test/test_store.ml | 701 ++-- src/lib_shell/test/test_store_checkpoint.ml | 141 +- src/lib_shell/validator.ml | 250 +- src/lib_shell/validator.mli | 37 +- src/lib_shell/worker.ml | 724 +++-- src/lib_shell/worker.mli | 119 +- src/lib_shell/worker_directory.ml | 195 +- src/lib_shell/worker_directory.mli | 2 +- src/lib_shell/worker_logger.ml | 191 +- src/lib_shell_services/block_services.ml | 991 +++--- src/lib_shell_services/block_services.mli | 615 ++-- .../block_validator_errors.ml | 627 ++-- .../block_validator_errors.mli | 59 +- .../block_validator_worker_state.ml | 95 +- .../block_validator_worker_state.mli | 16 +- src/lib_shell_services/chain_services.ml | 140 +- src/lib_shell_services/chain_services.mli | 150 +- .../chain_validator_worker_state.ml | 236 +- .../chain_validator_worker_state.mli | 55 +- src/lib_shell_services/connection_metadata.ml | 15 +- .../connection_metadata.mli | 10 +- src/lib_shell_services/history_mode.ml | 28 +- src/lib_shell_services/injection_services.ml | 134 +- src/lib_shell_services/injection_services.mli | 66 +- src/lib_shell_services/monitor_services.ml | 218 +- src/lib_shell_services/monitor_services.mli | 102 +- src/lib_shell_services/p2p_services.ml | 349 +- src/lib_shell_services/p2p_services.mli | 254 +- src/lib_shell_services/peer_metadata.ml | 686 ++-- src/lib_shell_services/peer_metadata.mli | 39 +- .../peer_validator_worker_state.ml | 148 +- .../peer_validator_worker_state.mli | 32 +- .../prevalidator_worker_state.ml | 173 +- .../prevalidator_worker_state.mli | 27 +- src/lib_shell_services/protocol_services.ml | 26 +- src/lib_shell_services/protocol_services.mli | 42 +- src/lib_shell_services/shell_services.ml | 4 +- src/lib_shell_services/shell_services.mli | 4 +- src/lib_shell_services/stat_services.ml | 127 +- src/lib_shell_services/stat_services.mli | 14 +- src/lib_shell_services/state_logging.ml | 4 +- src/lib_shell_services/state_logging.mli | 2 +- src/lib_shell_services/validation_errors.ml | 303 +- src/lib_shell_services/validation_errors.mli | 33 +- src/lib_shell_services/worker_services.ml | 100 +- src/lib_shell_services/worker_services.mli | 191 +- src/lib_shell_services/worker_types.ml | 108 +- src/lib_shell_services/worker_types.mli | 43 +- src/lib_signer_backends/encrypted.ml | 286 +- src/lib_signer_backends/encrypted.mli | 19 +- src/lib_signer_backends/http.ml | 4 +- src/lib_signer_backends/http.mli | 16 +- src/lib_signer_backends/http_gen.ml | 196 +- src/lib_signer_backends/http_gen.mli | 20 +- src/lib_signer_backends/https.ml | 4 +- src/lib_signer_backends/https.mli | 16 +- .../test/test_encrypted.ml | 217 +- src/lib_signer_backends/unencrypted.ml | 24 +- src/lib_signer_backends/unencrypted.mli | 5 +- src/lib_signer_backends/unix/ledger.ml | 1598 +++++----- src/lib_signer_backends/unix/ledger.mli | 6 + src/lib_signer_backends/unix/ledger_names.ml | 1832 +++++++++-- src/lib_signer_backends/unix/ledger_names.mli | 9 +- src/lib_signer_backends/unix/remote.ml | 218 +- src/lib_signer_backends/unix/remote.mli | 26 +- src/lib_signer_backends/unix/socket.ml | 234 +- src/lib_signer_backends/unix/socket.mli | 13 +- .../unix/test/test_crouching.ml | 13 +- src/lib_signer_services/signer_messages.ml | 217 +- src/lib_signer_services/signer_messages.mli | 37 +- src/lib_signer_services/signer_services.ml | 65 +- src/lib_signer_services/signer_services.mli | 54 +- src/lib_stdlib/compare.ml | 206 +- src/lib_stdlib/compare.mli | 33 +- src/lib_stdlib/hashPtree.ml | 1043 +++--- src/lib_stdlib/hashPtree.mli | 56 +- src/lib_stdlib/lwt_canceler.ml | 42 +- src/lib_stdlib/lwt_dropbox.ml | 61 +- src/lib_stdlib/lwt_dropbox.mli | 17 +- src/lib_stdlib/lwt_idle_waiter.ml | 66 +- src/lib_stdlib/lwt_idle_waiter.mli | 10 +- src/lib_stdlib/lwt_pipe.ml | 217 +- src/lib_stdlib/lwt_pipe.mli | 42 +- src/lib_stdlib/lwt_utils.ml | 214 +- src/lib_stdlib/lwt_utils.mli | 17 +- src/lib_stdlib/lwt_watcher.ml | 47 +- src/lib_stdlib/mBytes.ml | 39 +- src/lib_stdlib/mBytes.mli | 7 +- src/lib_stdlib/memory.ml | 23 +- src/lib_stdlib/memory.mli | 23 +- src/lib_stdlib/option.ml | 56 +- src/lib_stdlib/option.mli | 19 +- src/lib_stdlib/registry.ml | 50 +- src/lib_stdlib/registry.mli | 27 +- src/lib_stdlib/ring.ml | 111 +- src/lib_stdlib/ring.mli | 5 +- src/lib_stdlib/tag.ml | 227 +- src/lib_stdlib/tag.mli | 62 +- src/lib_stdlib/test/assert.ml | 6 +- src/lib_stdlib/test/test_lwt_pipe.ml | 46 +- src/lib_stdlib/test/test_tzList.ml | 70 +- src/lib_stdlib/tzList.ml | 175 +- src/lib_stdlib/tzList.mli | 36 +- src/lib_stdlib/tzString.ml | 55 +- src/lib_stdlib/tzString.mli | 13 +- src/lib_stdlib/utils.ml | 35 +- src/lib_stdlib/utils.mli | 8 +- src/lib_stdlib/weakRingTable.ml | 105 +- src/lib_stdlib/weakRingTable.mli | 24 +- src/lib_stdlib_unix/animation.ml | 38 +- src/lib_stdlib_unix/file_event_sink.ml | 665 ++-- src/lib_stdlib_unix/file_event_sink.mli | 35 +- src/lib_stdlib_unix/internal_event_unix.ml | 107 +- src/lib_stdlib_unix/internal_event_unix.mli | 14 +- src/lib_stdlib_unix/lwt_lock_file.ml | 72 +- src/lib_stdlib_unix/lwt_lock_file.mli | 8 +- src/lib_stdlib_unix/lwt_log_sink_unix.ml | 322 +- src/lib_stdlib_unix/lwt_log_sink_unix.mli | 17 +- src/lib_stdlib_unix/lwt_utils_unix.ml | 459 +-- src/lib_stdlib_unix/lwt_utils_unix.mli | 65 +- src/lib_stdlib_unix/moving_average.ml | 68 +- src/lib_stdlib_unix/moving_average.mli | 19 +- src/lib_stdlib_unix/sys_info.ml | 216 +- src/lib_stdlib_unix/systime_os.ml | 1 + src/lib_stdlib_unix/systime_os.mli | 4 +- src/lib_stdlib_unix/utils.ml | 16 +- src/lib_stdlib_unix/utils.mli | 6 +- src/lib_storage/context.ml | 896 +++--- src/lib_storage/context.mli | 155 +- src/lib_storage/context_dump.ml | 717 +++-- src/lib_storage/context_dump.mli | 116 +- src/lib_storage/raw_store.ml | 408 +-- src/lib_storage/raw_store.mli | 15 +- src/lib_storage/store_helpers.ml | 446 ++- src/lib_storage/store_helpers.mli | 48 +- src/lib_storage/store_logging.ml | 4 +- src/lib_storage/store_sigs.ml | 183 +- src/lib_storage/test/assert.ml | 66 +- src/lib_storage/test/test.ml | 7 +- src/lib_storage/test/test_context.ml | 364 ++- src/lib_storage/test/test_raw_store.ml | 102 +- src/lib_validation/block_validation.ml | 472 +-- src/lib_validation/block_validation.mli | 32 +- .../bin_accuser/main_accuser_alpha.ml | 15 +- src/proto_alpha/bin_baker/main_baker_alpha.ml | 15 +- .../bin_endorser/main_endorser_alpha.ml | 15 +- .../lib_client/client_proto_args.ml | 236 +- .../lib_client/client_proto_args.mli | 99 +- .../lib_client/client_proto_context.ml | 781 +++-- .../lib_client/client_proto_context.mli | 87 +- .../lib_client/client_proto_contracts.ml | 156 +- .../lib_client/client_proto_contracts.mli | 37 +- .../lib_client/client_proto_multisig.ml | 1009 +++--- .../lib_client/client_proto_multisig.mli | 65 +- .../lib_client/client_proto_programs.ml | 208 +- .../lib_client/client_proto_programs.mli | 40 +- src/proto_alpha/lib_client/injection.ml | 1225 ++++--- src/proto_alpha/lib_client/injection.mli | 25 +- .../lib_client/michelson_v1_emacs.ml | 237 +- .../lib_client/michelson_v1_emacs.mli | 7 +- .../lib_client/michelson_v1_error_reporter.ml | 782 +++-- .../michelson_v1_error_reporter.mli | 6 +- .../lib_client/michelson_v1_macros.ml | 1882 ++++++----- .../lib_client/michelson_v1_macros.mli | 24 + .../lib_client/michelson_v1_parser.ml | 90 +- .../lib_client/michelson_v1_parser.mli | 38 +- .../lib_client/michelson_v1_printer.ml | 121 +- .../lib_client/michelson_v1_printer.mli | 17 +- .../lib_client/operation_result.ml | 772 +++-- .../lib_client/operation_result.mli | 7 +- .../lib_client/protocol_client_context.ml | 456 ++- src/proto_alpha/lib_client/test/assert.ml | 10 +- .../test/test_michelson_v1_macros.ml | 1210 +++---- .../alpha_commands_registration.ml | 13 +- .../client_proto_context_commands.ml | 1808 ++++++----- .../client_proto_contracts_commands.ml | 88 +- .../client_proto_multisig_commands.ml | 1292 +++++--- .../client_proto_multisig_commands.mli | 2 +- .../client_proto_programs_commands.ml | 558 ++-- .../client_proto_programs_commands.mli | 2 +- .../lib_delegate/client_baking_blocks.ml | 187 +- .../lib_delegate/client_baking_blocks.mli | 31 +- .../client_baking_denunciation.ml | 450 +-- .../client_baking_denunciation.mli | 4 +- .../lib_delegate/client_baking_endorsement.ml | 400 +-- .../client_baking_endorsement.mli | 24 +- .../lib_delegate/client_baking_files.ml | 52 +- .../lib_delegate/client_baking_files.mli | 7 +- .../lib_delegate/client_baking_forge.ml | 1972 +++++++----- .../lib_delegate/client_baking_forge.mli | 75 +- .../client_baking_highwatermarks.ml | 87 +- .../client_baking_highwatermarks.mli | 23 +- .../lib_delegate/client_baking_lib.ml | 188 +- .../lib_delegate/client_baking_lib.mli | 44 +- .../lib_delegate/client_baking_nonces.ml | 217 +- .../lib_delegate/client_baking_nonces.mli | 39 +- .../lib_delegate/client_baking_pow.ml | 19 +- .../lib_delegate/client_baking_pow.mli | 4 +- .../lib_delegate/client_baking_revelation.ml | 65 +- .../lib_delegate/client_baking_revelation.mli | 6 +- .../lib_delegate/client_baking_scheduling.ml | 183 +- .../lib_delegate/client_baking_scheduling.mli | 8 +- .../lib_delegate/client_baking_simulator.ml | 112 +- .../lib_delegate/client_baking_simulator.mli | 31 +- src/proto_alpha/lib_delegate/client_daemon.ml | 205 +- .../lib_delegate/client_daemon.mli | 34 +- .../lib_delegate/delegate_commands.ml | 371 ++- .../lib_delegate/delegate_commands.mli | 2 + .../delegate_commands_registration.ml | 7 +- src/proto_alpha/lib_delegate/logging.ml | 136 +- src/proto_alpha/lib_delegate/logging.mli | 26 +- src/proto_alpha/lib_mempool/filter.ml | 252 +- .../lib_parameters/default_parameters.ml | 172 +- .../lib_parameters/default_parameters.mli | 17 +- src/proto_alpha/lib_parameters/gen.ml | 24 +- .../lib_protocol/test/activation.ml | 670 ++-- src/proto_alpha/lib_protocol/test/baking.ml | 48 +- .../lib_protocol/test/combined_operations.ml | 326 +- .../lib_protocol/test/delegation.ml | 1981 +++++++----- .../lib_protocol/test/double_baking.ml | 249 +- .../lib_protocol/test/double_endorsement.ml | 287 +- .../lib_protocol/test/endorsement.ml | 625 ++-- .../lib_protocol/test/helpers/account.ml | 41 +- .../lib_protocol/test/helpers/account.mli | 28 +- .../lib_protocol/test/helpers/assert.ml | 84 +- .../lib_protocol/test/helpers/block.ml | 470 +-- .../lib_protocol/test/helpers/block.mli | 70 +- .../lib_protocol/test/helpers/context.ml | 290 +- .../lib_protocol/test/helpers/context.mli | 97 +- .../lib_protocol/test/helpers/incremental.ml | 228 +- .../lib_protocol/test/helpers/incremental.mli | 26 +- .../lib_protocol/test/helpers/nonce.ml | 21 +- .../lib_protocol/test/helpers/nonce.mli | 8 +- .../lib_protocol/test/helpers/op.ml | 447 +-- .../lib_protocol/test/helpers/op.mli | 59 +- .../lib_protocol/test/helpers/test_tez.ml | 32 +- .../lib_protocol/test/helpers/test_utils.ml | 15 +- src/proto_alpha/lib_protocol/test/main.ml | 30 +- .../lib_protocol/test/origination.ml | 518 +-- src/proto_alpha/lib_protocol/test/qty.ml | 167 +- src/proto_alpha/lib_protocol/test/rolls.ml | 418 ++- src/proto_alpha/lib_protocol/test/seed.ml | 294 +- src/proto_alpha/lib_protocol/test/test.ml | 18 +- src/proto_alpha/lib_protocol/test/transfer.ml | 814 +++-- src/proto_alpha/lib_protocol/test/voting.ml | 1257 ++++---- src/proto_demo_noops/lib_protocol/main.ml | 121 +- .../lib_client/client_proto_main.ml | 211 +- .../lib_client/client_proto_main.mli | 4 +- .../lib_client/protocol_client_context.ml | 2 +- 703 files changed, 76048 insertions(+), 56383 deletions(-) diff --git a/docs/doc_gen/errors/error_doc.ml b/docs/doc_gen/errors/error_doc.ml index 9cf5c8d9e88a..c04ab374fa40 100644 --- a/docs/doc_gen/errors/error_doc.ml +++ b/docs/doc_gen/errors/error_doc.ml @@ -28,6 +28,7 @@ open Format (* TODO: add section descriptions *) let default_section_id = "default" + let default_section_title = "Miscellaneous" (* Association list where keys are set of identifier's prefixes that @@ -39,29 +40,34 @@ let default_section_title = "Miscellaneous" bottom of the document. Unprefixed ids or unreferenced prefixes will default to `Miscellaneous` *) let section_titles = - [ [ "proto.alpha" ], "Protocol Alpha"; - [ "distributed_db" ; "node" ; "raw_store" ; "validator" ; "worker" ], "Shell" ; - [ "micheline" ; "michelson" ], "Michelson parsing/macros" ; - [ "rpc_client" ], "Client" ; - [ "cli"; "utils"; default_section_id ], default_section_title ; - ] + [ (["proto.alpha"], "Protocol Alpha"); + (["distributed_db"; "node"; "raw_store"; "validator"; "worker"], "Shell"); + (["micheline"; "michelson"], "Michelson parsing/macros"); + (["rpc_client"], "Client"); + (["cli"; "utils"; default_section_id], default_section_title) ] + let pp_rst_title ~char ppf title = let sub = String.map (fun _ -> char) title in fprintf ppf "@[%s@\n@]@[%s@\n@\n@]" title sub let pp_rst_h1 = pp_rst_title ~char:'#' + let pp_rst_h2 = pp_rst_title ~char:'*' + (* let pp_rst_h3 = pp_rst_title ~char:'=' * let pp_rst_h4 = pp_rst_title ~char:'`' *) let string_of_err_category = function - | `Branch -> "branch" - | `Temporary -> "temporary" - | `Permanent -> "permanent" + | `Branch -> + "branch" + | `Temporary -> + "temporary" + | `Permanent -> + "permanent" let make_counter () = let i = ref 1 in - fun () -> incr i; !i + fun () -> incr i ; !i let count = make_counter () @@ -69,80 +75,105 @@ let unique_label () = let label = sprintf "ref%d" (count ()) in label -let pp_print_html_tab_button fmt ?(default=false) ~shortlabel ~content idref = - fprintf fmt "@ " +let pp_print_html_tab_button fmt ?(default = false) ~shortlabel ~content idref + = + fprintf + fmt + "@ " (if default then " defaultOpen" else "") - (idref ^ shortlabel) idref content + (idref ^ shortlabel) + idref + content -let pp_print_html_tabs fmt { Error_monad.id ; category ; description ; schema ; _ } = +let pp_print_html_tabs fmt {Error_monad.id; category; description; schema; _} = let idref = unique_label () in let descr_label = "descr" in let schema_label = "schema" in - - fprintf fmt "@[.. raw:: html@ @ "; - fprintf fmt "@[
@ "; - - fprintf fmt "%a" (pp_print_html_tab_button ~default:true ~shortlabel:descr_label ~content:"Description") idref; - fprintf fmt "%a" (pp_print_html_tab_button ~default:false ~shortlabel:schema_label ~content:"JSON Schema") idref; - fprintf fmt "@
@ @]"; - + fprintf fmt "@[.. raw:: html@ @ " ; + fprintf fmt "@[
@ " ; + fprintf + fmt + "%a" + (pp_print_html_tab_button + ~default:true + ~shortlabel:descr_label + ~content:"Description") + idref ; + fprintf + fmt + "%a" + (pp_print_html_tab_button + ~default:false + ~shortlabel:schema_label + ~content:"JSON Schema") + idref ; + fprintf fmt "@
@ @]" ; let description_content = - asprintf "

%s

Id : %s
Category : %s

" description id (string_of_err_category category) + asprintf + "

%s

Id : %s
Category : %s

" + description + id + (string_of_err_category category) in - - open_vbox 2; - + open_vbox 2 ; (* Print description *) - begin - fprintf fmt "
@ " - (idref ^ descr_label) idref; - fprintf fmt "%s@ " description_content; - fprintf fmt "
@]"; - end; - + fprintf + fmt + "
@ " + (idref ^ descr_label) + idref ; + fprintf fmt "%s@ " description_content ; + fprintf fmt "
@]" ; (* Print schema *) - begin - (* Hack: negative offset in order to reduce the
's content left-margin *)
-    (* TODO: pretty-(html)-print the schema *)
-    open_vbox (-8);
-    fprintf fmt "
@ " - (idref ^ schema_label) idref; - fprintf fmt "<%s>@ %a@ " "pre" Json_schema.pp schema "pre"; - fprintf fmt "
"; - close_box (); - end; + (* Hack: negative offset in order to reduce the
's content left-margin *)
+  (* TODO: pretty-(html)-print the schema *)
+  open_vbox (-8) ;
+  fprintf
+    fmt
+    "
@ " + (idref ^ schema_label) + idref ; + fprintf fmt "<%s>@ %a@ " "pre" Json_schema.pp schema "pre" ; + fprintf fmt "
" ; + close_box () ; close_box () -let pp_info_to_rst - ppf - (Error_monad.{ title ; _ } as error_info) = +let pp_info_to_rst ppf (Error_monad.{title; _} as error_info) = let open Format in + fprintf ppf "**%s**@\n@\n" (if title = "" then "" else title) ; + fprintf ppf "@[%a@ @ @]" pp_print_html_tabs error_info - fprintf ppf "**%s**@\n@\n" (if title = "" then "" else title); - fprintf ppf "@[%a@ @ @]" pp_print_html_tabs error_info; +module ErrorSet = Set.Make (struct + type t = Error_monad.error_info -module ErrorSet = Set.Make(struct - type t = Error_monad.error_info - let compare { Error_monad.id ; _ } { Error_monad.id = id' ; _ } = - String.compare id id' - end) + let compare {Error_monad.id; _} {Error_monad.id = id'; _} = + String.compare id id' +end) module ErrorPartition = struct - include Map.Make(struct - include String - let titles = List.map snd section_titles - - let compare s s' = - let idx s = - let rec loop acc = function - | [] -> assert false - | h::_ when h = s -> acc - | _::t -> loop (acc + 1) t - in loop 0 titles + include Map.Make (struct + include String + + let titles = List.map snd section_titles + + let compare s s' = + let idx s = + let rec loop acc = function + | [] -> + assert false + | h :: _ when h = s -> + acc + | _ :: t -> + loop (acc + 1) t in - Pervasives.compare (idx s) (idx s') - end) + loop 0 titles + in + Pervasives.compare (idx s) (idx s') + end) let add_error (id : key) (error : Error_monad.error_info) (map : 'a t) = let title = @@ -150,84 +181,45 @@ module ErrorPartition = struct snd (List.find (fun (id_set, _) -> - List.exists (fun pattern -> Stringext.find_from id ~pattern = Some 0) id_set) + List.exists + (fun pattern -> Stringext.find_from id ~pattern = Some 0) + id_set) section_titles) - with - | Not_found -> default_section_title - in - let set = - try find title map with Not_found -> ErrorSet.empty + with Not_found -> default_section_title in + let set = try find title map with Not_found -> ErrorSet.empty in add title (ErrorSet.add error set) map end let pp_error_map ppf (map : ErrorSet.t ErrorPartition.t) : unit = let open Format in - ErrorPartition.iter (fun section_title set -> + ErrorPartition.iter + (fun section_title set -> fprintf ppf "%a" pp_rst_h2 section_title ; - ErrorSet.iter (fun error_repr -> - fprintf ppf "@[%a@]@\n@\n" pp_info_to_rst error_repr - ) set - ) map + fprintf ppf "@[%a@]@\n@\n" pp_info_to_rst error_repr) + set) + map let script = - "" + "" let style = - "" + "" let print_script ppf = (* HACK : show/hide JSON schemas + style *) @@ -238,26 +230,22 @@ let print_script ppf = let () = let open Format in let ppf = std_formatter in - (* Header *) let title = "RPC Errors" in fprintf ppf "%a" pp_rst_h1 title ; - print_script ppf ; - - fprintf ppf - "This document references possible errors that can come \ - from RPC calls. It is generated from the OCaml source \ - code (master branch).@\n@\n" ; - + fprintf + ppf + "This document references possible errors that can come from RPC calls. \ + It is generated from the OCaml source code (master branch).@\n\ + @\n" ; (* Body *) let map = - let all_errors = - Error_monad.get_registered_errors () in + let all_errors = Error_monad.get_registered_errors () in List.fold_left - (fun acc ( Error_monad.{ id ; _ } as error ) -> - ErrorPartition.add_error id error acc - ) ErrorPartition.empty all_errors + (fun acc (Error_monad.{id; _} as error) -> + ErrorPartition.add_error id error acc) + ErrorPartition.empty + all_errors in - fprintf ppf "%a" pp_error_map map diff --git a/docs/doc_gen/node_helpers.ml b/docs/doc_gen/node_helpers.ml index 5fabb0fb8867..a9e3416eb63b 100644 --- a/docs/doc_gen/node_helpers.ml +++ b/docs/doc_gen/node_helpers.ml @@ -23,29 +23,31 @@ (* *) (*****************************************************************************) -let genesis : State.Chain.genesis = { - time = - Time.Protocol.of_notation_exn "2018-04-17T11:46:23Z" ; - block = - Block_hash.of_b58check_exn - "BLockGenesisGenesisGenesisGenesisGenesisa52f8bUWPcg" ; - protocol = - Protocol_hash.of_b58check_exn - "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im" ; -} +let genesis : State.Chain.genesis = + { + time = Time.Protocol.of_notation_exn "2018-04-17T11:46:23Z"; + block = + Block_hash.of_b58check_exn + "BLockGenesisGenesisGenesisGenesisGenesisa52f8bUWPcg"; + protocol = + Protocol_hash.of_b58check_exn + "ProtoGenesisGenesisGenesisGenesisGenesisGenesk612im"; + } let with_node f = let run dir = - let (/) = Filename.concat in - let node_config : Node.config = { - genesis ; - patch_context = None ; - store_root = dir / "store" ; - context_root = dir / "context" ; - p2p = None ; - test_chain_max_tll = None ; - checkpoint = None ; - } in + let ( / ) = Filename.concat in + let node_config : Node.config = + { + genesis; + patch_context = None; + store_root = dir / "store"; + context_root = dir / "context"; + p2p = None; + test_chain_max_tll = None; + checkpoint = None; + } + in Node.create node_config Node.default_peer_validator_limits @@ -53,10 +55,10 @@ let with_node f = Node.default_prevalidator_limits Node.default_chain_validator_limits None - >>=? fun node -> - f node >>=? fun () -> - return () in - Lwt_utils_unix.with_tempdir "tezos_rpcdoc_" run >>= function + >>=? fun node -> f node >>=? fun () -> return () + in + Lwt_utils_unix.with_tempdir "tezos_rpcdoc_" run + >>= function | Ok () -> Lwt.return_unit | Error err -> diff --git a/docs/doc_gen/p2p_doc.ml b/docs/doc_gen/p2p_doc.ml index 8925b2e7169d..f8322be7f20b 100644 --- a/docs/doc_gen/p2p_doc.ml +++ b/docs/doc_gen/p2p_doc.ml @@ -23,9 +23,8 @@ (* *) (*****************************************************************************) -let protocols = [ - "Alpha", "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK" ; -] +let protocols = + [("Alpha", "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK")] let main _node = (* Style : hack *) @@ -37,34 +36,40 @@ let main _node = (* include/copy usage.rst from input *) let rec loop () = let s = read_line () in - Format.printf "%s@\n" s ; - loop () in - begin try loop () with End_of_file -> () end ; + Format.printf "%s@\n" s ; loop () + in + (try loop () with End_of_file -> ()) ; Format.printf "@\n" ; (* Data *) - Format.printf "%a@\n@\n%a@\n@." - Rst.pp_h2 "Block header (shell)" + Format.printf + "%a@\n@\n%a@\n@." + Rst.pp_h2 + "Block header (shell)" Data_encoding.Binary_schema.pp (Data_encoding.Binary.describe Block_header.encoding) ; - Format.printf "%a@\n@\n%a@\n@." - Rst.pp_h2 "Operation (shell)" + Format.printf + "%a@\n@\n%a@\n@." + Rst.pp_h2 + "Operation (shell)" Data_encoding.Binary_schema.pp (Data_encoding.Binary.describe Operation.encoding) ; List.iter (fun (_name, hash) -> - let hash = Protocol_hash.of_b58check_exn hash in - let (module Proto) = Registered_protocol.get_exn hash in - Format.printf "%a@\n@\n%a@\n@." - Rst.pp_h2 "Block_header (alpha-specific)" - Data_encoding.Binary_schema.pp - (Data_encoding.Binary.describe Proto.block_header_data_encoding) ; - Format.printf "%a@\n@\n%a@\n@." - Rst.pp_h2 "Operation (alpha-specific)" - Data_encoding.Binary_schema.pp - (Data_encoding.Binary.describe Proto.operation_data_encoding) ; - ) + let hash = Protocol_hash.of_b58check_exn hash in + let (module Proto) = Registered_protocol.get_exn hash in + Format.printf + "%a@\n@\n%a@\n@." + Rst.pp_h2 + "Block_header (alpha-specific)" + Data_encoding.Binary_schema.pp + (Data_encoding.Binary.describe Proto.block_header_data_encoding) ; + Format.printf + "%a@\n@\n%a@\n@." + Rst.pp_h2 + "Operation (alpha-specific)" + Data_encoding.Binary_schema.pp + (Data_encoding.Binary.describe Proto.operation_data_encoding)) protocols ; return () -let () = - Lwt_main.run (Node_helpers.with_node main) +let () = Lwt_main.run (Node_helpers.with_node main) diff --git a/docs/doc_gen/rpc_doc.ml b/docs/doc_gen/rpc_doc.ml index 81e6b8b2dd0d..203b96dfe843 100644 --- a/docs/doc_gen/rpc_doc.ml +++ b/docs/doc_gen/rpc_doc.ml @@ -23,16 +23,18 @@ (* *) (*****************************************************************************) -let protocols = [ - "Alpha", "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK" ; -] +let protocols = + [("Alpha", "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK")] let pp_name ppf = function - | [] | [""] -> Format.pp_print_string ppf "/" - | prefix -> Format.pp_print_string ppf (String.concat "/" prefix) + | [] | [""] -> + Format.pp_print_string ppf "/" + | prefix -> + Format.pp_print_string ppf (String.concat "/" prefix) let ref_of_service (prefix, meth) = - Format.asprintf "%s_%s" + Format.asprintf + "%s_%s" (Resto.string_of_meth meth) (Re.Str.global_replace (Re.Str.regexp "<\\([^>]*\\)>") @@ -40,131 +42,148 @@ let ref_of_service (prefix, meth) = (String.concat "--" prefix)) module Index = struct - let rec pp prefix ppf dir = let open Resto.Description in match dir with - | Empty -> Format.fprintf ppf "Empty" - | Static { services ; subdirs = None } -> + | Empty -> + Format.fprintf ppf "Empty" + | Static {services; subdirs = None} -> pp_services prefix ppf services - | Static { services ; subdirs = Some (Suffixes map) } -> - Format.fprintf ppf "@[%a@ @ %a@]" - (pp_services prefix) services + | Static {services; subdirs = Some (Suffixes map)} -> + Format.fprintf + ppf + "@[%a@ @ %a@]" + (pp_services prefix) + services (Format.pp_print_list ~pp_sep:(fun ppf () -> Format.fprintf ppf "@ @ ") (pp_suffixes prefix)) (Resto.StringMap.bindings map) - | Static { services ; subdirs = Some (Arg (arg, dir)) } -> + | Static {services; subdirs = Some (Arg (arg, dir))} -> let name = Format.asprintf "<%s>" arg.name in - Format.fprintf ppf "@[%a@ @ %a@]" - (pp_services prefix) services - (pp_suffixes prefix) (name, dir) + Format.fprintf + ppf + "@[%a@ @ %a@]" + (pp_services prefix) + services + (pp_suffixes prefix) + (name, dir) | Dynamic _ -> Format.fprintf ppf "* %a ()" pp_name prefix - and pp_suffixes prefix ppf (name, dir) = - pp (prefix @ [name]) ppf dir + and pp_suffixes prefix ppf (name, dir) = pp (prefix @ [name]) ppf dir and pp_services prefix ppf services = - match (Resto.MethMap.bindings services) with + match Resto.MethMap.bindings services with | [] -> Format.fprintf ppf "* %a" pp_name prefix | _ :: _ as services -> - Format.fprintf ppf "* %a (@[%a@])" - pp_name prefix + Format.fprintf + ppf + "* %a (@[%a@])" + pp_name + prefix (Format.pp_print_list ~pp_sep:Format.pp_print_space - (pp_service_method prefix)) services + (pp_service_method prefix)) + services and pp_service_method prefix ppf (meth, _service) = - Format.fprintf ppf "`%s <%s_>`_" + Format.fprintf + ppf + "`%s <%s_>`_" (Resto.string_of_meth meth) (ref_of_service (prefix, meth)) - end module Description = struct - module Query = struct - let pp_arg fmt = let open RPC_arg in - function { name ; _ } -> - Format.fprintf fmt "<%s>" name + function {name; _} -> Format.fprintf fmt "<%s>" name let pp_title_item ppf = let open RPC_description in - function {name ; kind ; _ } -> - match kind with - | Single arg | Optional arg -> - Format.fprintf ppf "[%s=%a]" name pp_arg arg - | Flag -> - Format.fprintf ppf "[%s]" name - | Multi arg -> - Format.fprintf ppf "(%s=%a)\\*" name pp_arg arg + function + | {name; kind; _} -> ( + match kind with + | Single arg | Optional arg -> + Format.fprintf ppf "[%s=%a]" name pp_arg arg + | Flag -> + Format.fprintf ppf "[%s]" name + | Multi arg -> + Format.fprintf ppf "(%s=%a)\\*" name pp_arg arg ) let pp_title ppf query = - Format.fprintf ppf "%s%a" + Format.fprintf + ppf + "%s%a" (if query = [] then "" else "?") (Format.pp_print_list ~pp_sep:(fun ppf () -> Format.fprintf ppf "&") - pp_title_item) query + pp_title_item) + query let pp_html_arg fmt = let open RPC_arg in - function { name ; _ } -> - Format.fprintf fmt "<%s>" name + function {name; _} -> Format.fprintf fmt "<%s>" name let pp_item ppf = let open RPC_description in - function { name ; description ; kind } -> - begin match kind with - | Single arg - | Optional arg - | Multi arg -> - Format.fprintf ppf + function + | {name; description; kind} -> ( + ( match kind with + | Single arg | Optional arg | Multi arg -> + Format.fprintf + ppf "%s = %a" - name pp_html_arg arg - | Flag -> - Format.fprintf ppf - "%s" name - end ; - begin match description with - | None -> () - | Some descr -> Format.fprintf ppf " : %s" descr - end + pp_html_arg + arg + | Flag -> + Format.fprintf ppf "%s" name ) ; + match description with + | None -> + () + | Some descr -> + Format.fprintf ppf " : %s" descr ) let pp ppf query = match query with - | [] -> () + | [] -> + () | _ :: _ as query -> - Format.fprintf ppf + Format.fprintf + ppf "

Optional query arguments :

  • %a
" (Format.pp_print_list ~pp_sep:(fun ppf () -> Format.fprintf ppf "
  • ") pp_item) query - end module Tabs = struct - let pp_tab_div ppf f = - Format.fprintf ppf + Format.fprintf + ppf "@[
    %a
    @]" - (fun ppf () -> f ppf) () + (fun ppf () -> f ppf) + () let pp_tabcontent_div ~id ~class_ ppf f = - Format.fprintf ppf - "@[
    @ \ - %a@ \ - @]
    @ " - id class_ (fun ppf () -> f ppf) () - - let pp_button ppf ?(default=false) ~shortlabel ~content target_ref = - Format.fprintf ppf - "@ " + Format.fprintf + ppf + "@[
    @ %a@ @]
    @ " + id + class_ + (fun ppf () -> f ppf) + () + + let pp_button ppf ?(default = false) ~shortlabel ~content target_ref = + Format.fprintf + ppf + "@ " (if default then " defaultOpen" else "") (target_ref ^ shortlabel) target_ref @@ -172,94 +191,133 @@ module Description = struct let pp_content ppf ~tag ~shortlabel target_ref pp_content content = pp_tabcontent_div - ~id:(target_ref ^ shortlabel) ~class_:target_ref ppf - begin fun ppf -> - Format.fprintf ppf "<%s>@ %a" tag pp_content content tag - end + ~id:(target_ref ^ shortlabel) + ~class_:target_ref + ppf + (fun ppf -> + Format.fprintf ppf "<%s>@ %a" tag pp_content content tag) let pp_description ppf (service : _ RPC_description.service) = let open RPC_description in (* TODO collect and display arg description (in path and in query) *) - Format.fprintf ppf "@[%a@]%a" - Format.pp_print_text (Option.unopt ~default:"" service.description) - Query.pp service.query + Format.fprintf + ppf + "@[%a@]%a" + Format.pp_print_text + (Option.unopt ~default:"" service.description) + Query.pp + service.query let pp ppf prefix service = let open RPC_description in let target_ref = ref_of_service (prefix, service.meth) in - Rst.pp_html ppf begin fun ppf -> - pp_tab_div ppf begin fun ppf -> - pp_button ppf - ~default:true ~shortlabel:"descr" ~content:"Description" - target_ref ; - Option.iter service.input ~f: begin fun _ -> - pp_button ppf - ~default:false ~shortlabel:"input.json" ~content:"Json input" - target_ref ; - pp_button ppf - ~default:false ~shortlabel:"input.bin" ~content:"Binary input" - target_ref - end ; - pp_button ppf - ~default:false ~shortlabel:"output.json" ~content:"Json output" - target_ref ; - pp_button ppf - ~default:false ~shortlabel:"output.bin" ~content:"Binary output" - target_ref ; - end ; - pp_content ppf - ~tag:"p" ~shortlabel:"descr" target_ref - pp_description service ; - Option.iter service.input ~f: begin fun (schema, bin_schema) -> - pp_content ppf - ~tag:"pre" ~shortlabel:"input.json" target_ref - Json_schema.pp schema ; - pp_content ppf - ~tag:"pre" ~shortlabel:"input.bin" target_ref - Data_encoding.Binary_schema.pp bin_schema ; - end ; - pp_content ppf - ~tag:"pre" ~shortlabel:"output.json" target_ref - Json_schema.pp (fst service.output) ; - pp_content ppf - ~tag:"pre" ~shortlabel:"output.bin" target_ref - Data_encoding.Binary_schema.pp (snd service.output) ; - end - + Rst.pp_html ppf (fun ppf -> + pp_tab_div ppf (fun ppf -> + pp_button + ppf + ~default:true + ~shortlabel:"descr" + ~content:"Description" + target_ref ; + Option.iter service.input ~f:(fun _ -> + pp_button + ppf + ~default:false + ~shortlabel:"input.json" + ~content:"Json input" + target_ref ; + pp_button + ppf + ~default:false + ~shortlabel:"input.bin" + ~content:"Binary input" + target_ref) ; + pp_button + ppf + ~default:false + ~shortlabel:"output.json" + ~content:"Json output" + target_ref ; + pp_button + ppf + ~default:false + ~shortlabel:"output.bin" + ~content:"Binary output" + target_ref) ; + pp_content + ppf + ~tag:"p" + ~shortlabel:"descr" + target_ref + pp_description + service ; + Option.iter service.input ~f:(fun (schema, bin_schema) -> + pp_content + ppf + ~tag:"pre" + ~shortlabel:"input.json" + target_ref + Json_schema.pp + schema ; + pp_content + ppf + ~tag:"pre" + ~shortlabel:"input.bin" + target_ref + Data_encoding.Binary_schema.pp + bin_schema) ; + pp_content + ppf + ~tag:"pre" + ~shortlabel:"output.json" + target_ref + Json_schema.pp + (fst service.output) ; + pp_content + ppf + ~tag:"pre" + ~shortlabel:"output.bin" + target_ref + Data_encoding.Binary_schema.pp + (snd service.output)) end let rec pp prefix ppf dir = let open Resto.Description in match dir with - | Empty -> () - | Static { services ; subdirs = None } -> + | Empty -> + () + | Static {services; subdirs = None} -> pp_services prefix ppf services - | Static { services ; subdirs = Some (Suffixes map) } -> + | Static {services; subdirs = Some (Suffixes map)} -> pp_services prefix ppf services ; - Format.pp_print_list (pp_suffixes prefix) - ppf (Resto.StringMap.bindings map) - | Static { services ; subdirs = Some (Arg (arg, dir)) } -> + Format.pp_print_list + (pp_suffixes prefix) + ppf + (Resto.StringMap.bindings map) + | Static {services; subdirs = Some (Arg (arg, dir))} -> let name = Format.asprintf "<%s>" arg.name in pp_services prefix ppf services ; pp_suffixes prefix ppf (name, dir) - | Dynamic _ -> () + | Dynamic _ -> + () - and pp_suffixes prefix ppf (name, dir) = - pp (prefix @ [name]) ppf dir + and pp_suffixes prefix ppf (name, dir) = pp (prefix @ [name]) ppf dir and pp_services prefix ppf services = - List.iter - (pp_service prefix ppf) - (Resto.MethMap.bindings services) + List.iter (pp_service prefix ppf) (Resto.MethMap.bindings services) and pp_service prefix ppf (meth, service) = Rst.pp_ref ppf (ref_of_service (prefix, meth)) ; - Format.fprintf ppf "**%s %a%a**@\n@\n" + Format.fprintf + ppf + "**%s %a%a**@\n@\n" (Resto.string_of_meth meth) - pp_name prefix - Query.pp_title service.query ; + pp_name + prefix + Query.pp_title + service.query ; Tabs.pp ppf prefix service - end let pp_document ppf descriptions = @@ -274,8 +332,8 @@ let pp_document ppf descriptions = Rst.pp_h2 ppf "RPCs - Index" ; List.iter (fun (name, prefix, rpc_dir) -> - Rst.pp_h3 ppf name ; - Format.fprintf ppf "%a@\n@\n" (Index.pp prefix) rpc_dir) + Rst.pp_h3 ppf name ; + Format.fprintf ppf "%a@\n@\n" (Index.pp prefix) rpc_dir) descriptions ; (* Full description *) Rst.pp_h2 ppf "RPCs - Full description" ; @@ -284,8 +342,8 @@ let pp_document ppf descriptions = Format.pp_set_max_indent ppf 76 ; List.iter (fun (name, prefix, rpc_dir) -> - Rst.pp_h3 ppf name ; - Format.fprintf ppf "%a@\n@\n" (Description.pp prefix) rpc_dir) + Rst.pp_h3 ppf name ; + Format.fprintf ppf "%a@\n@\n" (Description.pp prefix) rpc_dir) descriptions let main node = @@ -293,22 +351,25 @@ let main node = let protocol_dirs = List.map (fun (name, hash) -> - let hash = Protocol_hash.of_b58check_exn hash in - let (module Proto) = Registered_protocol.get_exn hash in - "Protocol " ^ name, - [".." ; ""] , - RPC_directory.map (fun () -> assert false) @@ - Block_directory.build_raw_rpc_directory (module Proto) (module Proto)) - protocols in + let hash = Protocol_hash.of_b58check_exn hash in + let (module Proto) = Registered_protocol.get_exn hash in + ( "Protocol " ^ name, + [".."; ""], + RPC_directory.map (fun () -> assert false) + @@ Block_directory.build_raw_rpc_directory + (module Proto) + (module Proto) )) + protocols + in let dirs = ("Shell", [""], shell_dir) :: protocol_dirs in Lwt_list.map_p (fun (name, path, dir) -> - RPC_directory.describe_directory ~recurse:true ~arg:() dir >>= fun dir -> - Lwt.return (name, path, dir)) - dirs >>= fun descriptions -> + RPC_directory.describe_directory ~recurse:true ~arg:() dir + >>= fun dir -> Lwt.return (name, path, dir)) + dirs + >>= fun descriptions -> let ppf = Format.std_formatter in pp_document ppf descriptions ; return () -let () = - Lwt_main.run (Node_helpers.with_node main) +let () = Lwt_main.run (Node_helpers.with_node main) diff --git a/docs/doc_gen/rst.ml b/docs/doc_gen/rst.ml index 232a5397ae07..045d2a8b157a 100644 --- a/docs/doc_gen/rst.ml +++ b/docs/doc_gen/rst.ml @@ -28,24 +28,30 @@ let pp_title ~char ppf title = Format.fprintf ppf "@[%s@ %s@ @ @]" title sub let pp_h1 = pp_title ~char:'#' + let pp_h2 = pp_title ~char:'*' + let pp_h3 = pp_title ~char:'=' + let pp_h4 = pp_title ~char:'`' let pp_raw_html ppf str = - Format.fprintf ppf "@[.. raw:: html@ @ %s@ @ @]" + Format.fprintf + ppf + "@[.. raw:: html@ @ %s@ @ @]" (Re.Str.global_replace (Re.Str.regexp "\n") "\n " str) let pp_html ppf f = - Format.fprintf ppf + Format.fprintf + ppf "@[.. raw:: html@ @ %a@]@\n@\n" - (fun ppf () -> f ppf) () + (fun ppf () -> f ppf) + () let pp_ref ppf name = Format.fprintf ppf ".. _%s :@\n@\n" name - - -let style = {css| +let style = + {css| |css} -let script = {script| +let script = + {script|