Skip to content

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

Merged
merged 5 commits into from
Jan 22, 2024

Conversation

IAmPara0x
Copy link
Contributor

preserve severity from HLint

Copy link
Collaborator

@michaelpj michaelpj left a 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.

@IAmPara0x
Copy link
Contributor Author

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?

@michaelpj
Copy link
Collaborator

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

Copy link
Collaborator

@fendor fendor left a 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.

@michaelpj
Copy link
Collaborator

@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 :/

@IAmPara0x
Copy link
Contributor Author

IAmPara0x commented Dec 15, 2023

@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.

@michaelpj
Copy link
Collaborator

I don't think we have that information from hlint though, do we?

@michaelpj
Copy link
Collaborator

@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?

@IAmPara0x
Copy link
Contributor Author

IAmPara0x commented Jan 18, 2024

@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

@IAmPara0x
Copy link
Contributor Author

IAmPara0x commented Jan 20, 2024

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.

@michaelpj michaelpj added the merge me Label to trigger pull request merge label Jan 22, 2024
@mergify mergify bot merged commit af5cd2d into haskell:master Jan 22, 2024
josephsumabat pushed a commit to josephsumabat/haskell-language-server that referenced this pull request Jan 22, 2024
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants