@@ -3,25 +3,25 @@ We test it here while calling it from the shell.
3
3
4
4
By default the command reads from `stdin`.
5
5
6
- $ echo ' (lang dune 3.17)' | dunolint tools lint-file
6
+ $ printf ' (lang dune 3.17)\n ' | dunolint tools lint-file
7
7
Error: Cannot infer the file kind from the filename " stdin" .
8
8
Hint: You may override the filename with the flag [-- filename].
9
9
[123 ]
10
10
11
11
However, when using the command that way, the linted file kind won't be
12
12
inferred. The filename must end with a basename that indicates a supported mode.
13
13
14
- $ echo ' (lang dune 3.17)' | dunolint tools lint-file -- filename= dune-project
14
+ $ printf ' (lang dune 3.17)\n ' | dunolint tools lint-file -- filename= dune-project
15
15
(lang dune 3.17 )
16
16
17
17
By default , the contents is auto-formatted.
18
18
19
- $ echo ' (lang\n dune\n 3.17)' | dunolint tools lint-file -- filename= dune-project
19
+ $ printf ' (lang\n dune\n 3.17)\n ' | dunolint tools lint-file -- filename= dune-project
20
20
(lang dune 3.17 )
21
21
22
22
The formatting may however be disabled.
23
23
24
- $ echo ' (lang\n dune\n 3.17)' \
24
+ $ printf ' (lang\n dune\n 3.17)\n ' \
25
25
> | dunolint tools lint-file -- filename= dune-project \
26
26
> -- format-file= false
27
27
(lang
@@ -100,7 +100,7 @@ When the command fails to parse the file, it complains and exits with a non-zero
100
100
code. This should be handled by the logic responsible for the editor
101
101
integration.
102
102
103
- $ echo " (invalid sexp" | dunolint tools lint-file -- filename= dune
103
+ $ printf " (invalid sexp\n " | dunolint tools lint-file -- filename= dune
104
104
File " dune" , line 2 , characters 0 -0:
105
105
Error: unclosed parentheses at end of input
106
106
[123 ]
@@ -109,7 +109,7 @@ Next we are going to test the command with config.
109
109
110
110
The command may be passed a config file.
111
111
112
- $ echo ' ((rules ()))' > . dunolint
112
+ $ printf ' ((rules ()))\n ' > . dunolint
113
113
114
114
$ dunolint tools lint dune -- config= . dunolint
115
115
(library
@@ -255,9 +255,10 @@ contents is saved in the input file and not at the overridden path.
255
255
(name mylib)
256
256
(libraries a b c))
257
257
258
- $ ls -l path/ to / dune
259
- ls: cannot access ' path/to/dune' : No such file or directory
260
- [2 ]
258
+ This should not have created a file with the given filename.
259
+
260
+ $ test -e path/ to / dune
261
+ [1 ]
261
262
262
263
The command is idempotent.
263
264
0 commit comments