Skip to content

Commit 08473fa

Browse files
committed
Add a test that ignores all hints then enables a lhs-rhs hint
1 parent 1f29662 commit 08473fa

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ Ignore directives can also be written in the hint files:
324324

325325
These directives are applied in the order they are given, with later hints overriding earlier ones.
326326

327-
You can choose to ignore all hints with `- ignore: {}` then selectively enable the ones you want (e.g. `- warn: {name: Use const}`), but it isn't a totally smooth experience (see [#747](https://github.com/ndmitchell/hlint/issues/747) and [#748](https://github.com/ndmitchell/hlint/issues/748)).
327+
You can choose to ignore all hints with `- ignore: {}` then selectively enable the ones you want (e.g. `- warn: {name: Use const}`), but it isn't a totally smooth experience (see [#748](https://github.com/ndmitchell/hlint/issues/748)).
328328

329329
Finally, `hlint` defines the `__HLINT__` preprocessor definition (with value `1`), so problematic definitions (including those that don't parse) can be hidden with:
330330

data/test-ignore-all-then-error.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- ignore: {}
2+
- error:
3+
name: 'Only use one undefined'
4+
lhs: 'undefined undefined'
5+
rhs: 'undefined'

tests/ignore-all.test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---------------------------------------------------------------------
2+
RUN tests/ignore-all-then-error.hs --hint=data/test-ignore-all-then-error.yaml
3+
FILE tests/ignore-all-then-error.hs
4+
main = undefined undefined
5+
OUTPUT
6+
tests/ignore-all-then-error.hs:1:8-26: Error: Only use one undefined
7+
Found:
8+
undefined undefined
9+
Perhaps:
10+
undefined
11+
12+
1 error

0 commit comments

Comments
 (0)