Packages
bond
1.12.0
1.13.0
1.12.0
1.11.0
1.10.1
1.10.0
1.9.0
1.8.0
1.7.0
1.6.0
1.5.0
1.4.0
1.3.0
1.3.0-rc.1
1.2.1
1.2.0
1.1.0
1.0.0
1.0.0-rc.4
1.0.0-rc.3
1.0.0-rc.2
1.0.0-rc.1
0.18.0
0.17.5
0.17.4
0.17.3
0.17.2
0.17.1
0.17.0
0.16.2
0.16.1
0.16.0
0.15.0
0.14.0
0.13.0
0.12.0
0.11.0
0.10.0
0.9.1
0.9.0
0.8.3
0.8.2
0.8.1
0.1.0
Design by Contract (DbC) for Elixir
Current section
Files
Jump to
Current section
Files
.formatter.exs
# Used by "mix format"
#
# `contract_rules` is duplicated verbatim into `:locals_without_parens` (for
# bond's own source) and `:export.locals_without_parens` (for downstream
# projects that put `:bond` in their `:import_deps`). They MUST match: `@pre kw`
# parses as `@(pre(kw))`, and the formatter only drops the parens around the
# inner `pre(...)`/`post(...)`/`state_invariant(...)` call when that name is in
# the *formatting* project's `:locals_without_parens`. The `@`-prefix special
# case covers only the single-argument form, so a bare `@pre x: 1` formatted
# without a rule, but every multi-argument contract — `@post where(...), a, b`
# and every `@state_invariant`/`@invariant`/`@transition_invariant` — got
# re-parenthesised. `:*` (any arity) is required because the `where`/`whenever`
# form takes an arbitrary number of scoped assertions.
#
# Kept as a literal (not a local binding) so tools that read `.formatter.exs`
# structurally, without evaluating it, still see the rules.
[
import_deps: [:stream_data],
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"],
locals_without_parens: [
check: :*,
old: 1,
pre: :*,
post: :*,
invariant: :*,
state_invariant: :*,
transition_invariant: :*,
@: 1,
@: 2
],
export: [
locals_without_parens: [
check: :*,
old: 1,
pre: :*,
post: :*,
invariant: :*,
state_invariant: :*,
transition_invariant: :*
]
]
]