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

how to enable one specific ruleset? #1319

Open
jwaldmann opened this issue Nov 30, 2021 · 2 comments
Open

how to enable one specific ruleset? #1319

jwaldmann opened this issue Nov 30, 2021 · 2 comments

Comments

@jwaldmann
Copy link

How do I enable just the warnings/suggestions provided by the rules from one file?
(NorfairKing/haskell-dangerous-functions#18)

I tried

hlint --hint=hlint.yaml src/ 

but this will use hlint's built-in rules as well - I think that's the meaing of the first to lines of .. -v .. output

# Initialise of global flags... took 0.00s
# Config of data/hlint.yaml... took 0.17s
# Config of hlint.yaml... took 0.00s
# Parse of src/...

I tried to put - ignore: { } at the start, but then I get no output at all (I think that's #748)

@zliu41
Copy link
Collaborator

zliu41 commented Dec 8, 2021

Currently, if you put - ignore: { } at the start, then you must explicitly turn on any hint you want.
In other words, this does not produce any hint:

- ignore: { }
- warn: {lhs: mapM, rhs: traverse}

You need to turn on the hint by

- ignore: { }
- warn: {name: Use traverse}
- warn: {lhs: mapM, rhs: traverse}

This is obviously redundant, and what's worse, the hint name "Use traverse" is auto-generated, and may not be obvious to whoever created the hint. I think we should make it so that whatever follows - ignore is turned on automatically.

@ndmitchell
Copy link
Owner

That seems a very reasonable solution @zliu41 - patch welcome

zliu41 added a commit to zliu41/hlint that referenced this issue Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants