-
-
Notifications
You must be signed in to change notification settings - Fork 370
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
update hlint to 3.8 and prevent linting on testdata dir #4018
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
|
||
- name: 'Checking code' | ||
uses: rwe/actions-hlint-run@v2 | ||
with: | ||
hlint-bin: "hlint --with-group=extra" | ||
hlint-bin: "hlint --with-group=extra --ignore-glob=**/testdata/** --ignore-glob=**/test/data/**" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you leave a comment with a link to the hlint issue so we know to move this back into the config file when it gets fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dig into the hlint source code and found this. There is no option to configure the ignore glob, 0 0. Also no issue in hlint about this.
allowFields v ["lhs","rhs","note","name","side"]
let hintRuleScope = mempty
pure $
Left HintRule {hintRuleSeverity = severity, hintRuleLHS = extendInstances lhs, hintRuleRHS = extendInstances rhs, ..}
: [Right $ Classify severity hintRuleName "" "" | not isBuiltin]
else do
names <- parseFieldOpt "name" v >>= maybe (pure []) parseArrayString
within <- parseFieldOpt "within" v >>= maybe (pure [("","")]) (parseArray >=> concatMapM parseWithin)
pure [Right $ Classify severity n a b | (a,b) <- within, n <- ["" | null names] ++ names]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correction: within
field is just about module by module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only source code I see about using ignoring glob is
ignore = (toPredicate $ cmdIgnoreGlob cmd)
toPredicate :: [FilePattern] -> FilePath -> Bool
toPredicate [] = const False
toPredicate globs = \x -> not $ null $ m [((), cleanup x)]
where m = matchMany (map ((),) globs)
where cmdIgnoreGlob is only picked up by commandline arg
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, didn't you do ndmitchell/hlint#1554 ? So we can fix put this back once that is released?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that one is about apply the ignoring glob correctly, it is already included in the hlint 3.8 realease.
Before that, even with commandline ignoring glob, we won't be ignoring some files.
I thought that one would fix config file problem, but I was wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ndmitchell/hlint#1554 is the reason we need to bump up to 3.8
This is a following up of #3901
I dig a bit into hlint.