Browse Source

clean code

master
zapashcanon 2 years ago
parent
commit
a29bb5840c
Signed by: zapashcanon GPG Key ID: 8981C3C62D1D28F1
  1. 42
      .ocamlformat
  2. 13
      examples/print_code.ml
  3. 2
      src/dune
  4. 4
      test/dune
  5. 12
      test/test.ml

42
.ocamlformat

@ -0,0 +1,42 @@
version=0.20.1
assignment-operator=end-line
break-cases=fit
break-fun-decl=wrap
break-fun-sig=wrap
break-infix=wrap
break-infix-before-func=false
break-separators=before
break-sequences=true
cases-exp-indent=2
cases-matching-exp-indent=normal
doc-comments=before
doc-comments-padding=2
doc-comments-tag-only=default
dock-collection-brackets=false
exp-grouping=preserve
field-space=loose
if-then-else=compact
indicate-multiline-delimiters=space
indicate-nested-or-patterns=unsafe-no
infix-precedence=indent
leading-nested-match-parens=false
let-and=sparse
let-binding-spacing=compact
let-module=compact
margin=80
max-indent=68
module-item-spacing=sparse
ocp-indent-compat=false
parens-ite=false
parens-tuple=always
parse-docstrings=true
sequence-blank-line=preserve-one
sequence-style=terminator
single-case=compact
space-around-arrays=true
space-around-lists=true
space-around-records=true
space-around-variants=true
type-decl=sparse
wrap-comments=false
wrap-fun-args=true

13
examples/print_code.ml

@ -1,7 +1,8 @@
let () =
Format.printf "succes code is %d@." Exit.success_code ;
Format.printf "failure code is %d@." Exit.failure_code ;
if Exit.success_code <> 0 || Exit.failure_code <> 1 then (
Format.printf "not POSIX !@." ;
Exit.failure () ) ;
Exit.success ()
Format.printf "succes code is %d@\n" Exit.success_code;
Format.printf "failure code is %d@\n" Exit.failure_code;
if Exit.success_code = 0 && Exit.failure_code = 1 then Exit.success ()
else begin
Format.printf "not POSIX !@\n";
Exit.failure ()
end

2
src/dune

@ -3,8 +3,6 @@
(modules exit external)
(private_modules external)
(wrapped false)
(preprocess
(pps bisect_ppx -- --conditional))
(foreign_stubs
(language c)
(names external_stubs)))

4
test/dune

@ -1,3 +1,3 @@
(test
(name test)
(libraries exit))
(name test)
(libraries exit))

12
test/test.ml

@ -1,6 +1,6 @@
;;
assert (Exit.success_code >= 0) ;
assert (Exit.failure_code >= 0) ;
assert (Exit.success_code <= 255) ;
assert (Exit.failure_code <= 255) ;
assert (Exit.success_code <> Exit.failure_code)
let () =
assert (Exit.success_code >= 0);
assert (Exit.failure_code >= 0);
assert (Exit.success_code <= 255);
assert (Exit.failure_code <= 255);
assert (Exit.success_code <> Exit.failure_code)

Loading…
Cancel
Save