Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: disable formatting for a single dune file #6465

Merged
merged 2 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions test/blackbox-tests/test-cases/formatting/disable-dune-file.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
This tests how it is possible to disable formatting for a particular dialect in
a given subdirectory. This can be used to disable formatting of a particular
dune file.

$ cat > dune-project << EOF
> (lang dune 2.8)
> EOF

$ cat > dune << EOF
> ; this file should be formatted
> (rule (write-file a b))
> EOF

$ mkdir sub
$ cat > sub/dune << EOF
> ; this file should not
> (env
> (_
> (formatting (enabled_for ocaml))))
>
> (rule (write-file a b))
> EOF

$ dune build @fmt
File "dune", line 1, characters 0-0:
Error: Files _build/default/dune and _build/default/.formatted/dune differ.
[1]