-
-
Notifications
You must be signed in to change notification settings - Fork 389
Hlinting partial functions #2634
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
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.
looks good to me, I am for leverage hlint rules
I would not interfere local development for now, the CI check at the end of the main work seems to be the preferred workflow
maybe we could start for each subpackage (in separate prs) starting with the easier ones, with a minimal hlint file in the root which passes linting with no changes
not sure if it is possible automatically but a section about hlint in the contributing guide could help with that |
Personally, I would prefer to bring the |
Sorry, I didn't get to resurrecting the PR where I started to get rid of those partial functions. |
Proof of concept for the first step of #2514: installing CI that would prevent new usages of partial functions while permitting legacy use.
My intention in this PR is to get an agreement on plausibly-controversial decisions before going full speed on implementing them.
I have taken the liberty of promoting the "Avoid restricted function" hint from a warning to an error. As I understand, novel uses of partial functions are thoroughly undesired, and merely Warning on them would not be enough to prevent appearances in code: hlint CI output was empty on installation and contains some warnings now.
(It is still possible to add exceptions, and to add warning-level hints against functions; I can document that if desired.)
(Alternatively, there might be a way to make CI hlinting action throw partial successes / warnings / other visible indication of something being wrong whenever there are warnings, which would serve to bring contributor's and reviewers' attention to them.)
Questions I am not sure I can decide myself:
ghcide/
; should it be moved to the root, and applied to all subprojects? (I see a pro in the uniform enforcement of the code style, and a con in that plugin owners may want their own code style conventions.)