Skip to content

Commit

Permalink
Deprecate option 'disambiguate-non-breaking-match' (ocaml-ppx#1805)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetiot committed Sep 14, 2021
1 parent 7e6aac8 commit 22a3707
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Expand Up @@ -6,6 +6,8 @@

+ Options `--align-cases`, `--align-constructors-decl` and `--align-variants-decl` are now deprecated and will be removed by version 1.0 (#1793, @gpetiot)

+ Option `disambiguate-non-breaking-match` is now deprecated and will be removed by version 1.0 (#1805, @gpetiot)

#### Bug fixes

+ Fix normalization of sequences of expressions (#1731, @gpetiot)
Expand Down
3 changes: 2 additions & 1 deletion lib/Conf.ml
Expand Up @@ -484,9 +484,10 @@ module Formatting = struct
let doc =
"Add parentheses around matching constructs that fit on a single line."
in
let deprecated = C.deprecated ~since_version:"0.20.0" removed_by_v1_0 in
C.flag
~names:["disambiguate-non-breaking-match"]
~default:false ~doc ~section
~default:false ~doc ~section ~deprecated
(fun conf x -> {conf with disambiguate_non_breaking_match= x})
(fun conf -> conf.disambiguate_non_breaking_match)

Expand Down
4 changes: 3 additions & 1 deletion ocamlformat-help.txt
Expand Up @@ -157,7 +157,9 @@ OPTIONS (CODE FORMATTING STYLE)

--disambiguate-non-breaking-match
Add parentheses around matching constructs that fit on a single
line. The flag is unset by default.
line. The flag is unset by default. Warning: This option is
deprecated since version 0.20.0. It will be removed by version
1.0.

--doc-comments={after-when-possible|before-except-val|before}
Doc comments position. after-when-possible puts doc comments after
Expand Down
1 change: 1 addition & 0 deletions test/passing/tests/disambiguate.ml.err
@@ -0,0 +1 @@
Warning: disambiguate-non-breaking-match: This option is deprecated since version 0.20.0. It will be removed by version 1.0.

0 comments on commit 22a3707

Please sign in to comment.