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

"ignore: {}" causes restricted functions and imports to be ignored #748

Open
langston-barrett opened this issue Aug 23, 2019 · 2 comments
Open

Comments

@langston-barrett
Copy link

In HLint 2.2.2, the following config:

- ignore: {}
- functions:
  - {name: putStrLn, within: []}
- modules:
  - {name: [Data.List], as: List}

causes no warning to be issued on the following module:

module Main where
import Data.List as L
main :: IO ()
main = putStrLn $ L.intercalate " " ["hlint", "is", "awesome"]

whereas the appropriate warnings are raised without the ignore: {}. This is counterintuitive to me, because the README says:

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

@ndmitchell
Copy link
Owner

The logic is that when you type functions you are providing predicates for the banned function warning. However, you aren't enabling the banned function warning, just configuring it. So separately you ignored it, and haven't put in a corresponding unignore directive, so it remains ignored. Does that at least make sense why it happens that way?

@langston-barrett
Copy link
Author

Yeah, that makes sense. Is there a way to enable them after configuring them?

It seems like in the more normal configuration (not ignoring everything), enabling and configuring go hand in hand. But when using ignore: {}, these become separate steps. That makes sense of #747 as well, the difference there being that I figured out a workaround for that.

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

2 participants