-
-
Notifications
You must be signed in to change notification settings - Fork 389
Fix issue: HLS HLint plugin doesn't preserve HLint's severities #3881 #3902
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
Conversation
…ll#3881 preserve severity from HLint
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.
Code looks good. I think we need to think carefully about whether we definitely want. This means that most hlint hints will turn up as warnings now. Is that too strong? I guess not - that's what hlint says they are, and if a hint seems too strong at that level then arguably that's a hlint bug.
I agree with you here, mainly because if people are using hlint plugin then they are using hlint and hlint gives warnings most of the times than not for the hints. So, if we don't propagate the severity of hlint, it's not an expected behaviour? |
I do think hlint uses "warning" for a bunch of things that don't seem worthy of it to me. I've opened an issue on the hlint repo to discuss: ndmitchell/hlint#1549 |
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.
Code changes look good to me, but I am also unsure whether we want to treat hlint warnings as warnings.
@IAmPara0x I'm not sure how to progress really. We could demote all of hlint's diagnostics by one level, but that doesn't really address your original annoyance that a hlint error wasn't showing up as an error. And the only real difference it would make is that hlint errors would be warnings instead of infos. I do think that passing through hlint's severities as they are is likely to seem worse to our users :/ |
Yes, I think you are right here. Propagating default errors and warnings would confuse the users. Maybe an alternative, solution will be to only propagate severities of only those hints that are user defined? And passing the default as infos/suggestions. |
I don't think we have that information from hlint though, do we? |
@IAmPara0x it looks like we got a suggestion from Neil that might work: preserve error severity and downgrade the others to info. How does that sound to you? |
Sounds, good. I will update the PR to reflect the changes |
I have updated the PR as we have decided, we now only preserve error severity from Hlint and rest everything is info. Let me know if the PR needs any further updates. Initially I had an idea of changing the severity levels if they were defined explicitly in .hlint.yaml in the project's root directory. Though I am not sure, how much work it will be. |
…ll#3881 (haskell#3902) * Fix issue: HLS HLint plugin doesn't preserve HLint's severities haskell#3881 preserve severity from HLint * Fix tests * Only preserve error serverity from hlint * Add comment explaining the propogation of error level serverity --------- Co-authored-by: Michael Peyton Jones <[email protected]>
preserve severity from HLint