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

New script to sync hlint rules #2836

Merged
merged 1 commit into from
Jun 18, 2021
Merged

New script to sync hlint rules #2836

merged 1 commit into from
Jun 18, 2021

Conversation

newhoggy
Copy link
Contributor

No description provided.

@newhoggy
Copy link
Contributor Author

newhoggy commented Jun 17, 2021

This introduces a new script scripts/reconfigure-hlint.sh.

When run, this script will find extract all the HLINT rules in the project's *.hs files and insert them into .hlint.yaml in between the sections marked # BEGIN-GENERATED and # END-GENERATED. Any existing content will be replaced.

This script is needed because the currently Haskell Language Server is unable to parse HLINT annotations in Haskell modules and can only read rules in the .hlint.yaml file. This is despite HLINT annotations being the recommended way to describe hlint rules.

@newhoggy newhoggy force-pushed the sync-hlint-rules branch 5 times, most recently from 5afefa8 to f843066 Compare June 17, 2021 04:30
@@ -53,7 +53,7 @@
# Ignore some builtin hints
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How often is this file likely to change? Its basiclay (mostly?) autogenerated,.If it changes all the time the it maybe should not be stored in git.

Copy link
Contributor Author

@newhoggy newhoggy Jun 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've renamed .hlint.yaml to .hlint.template.yaml and added .hlint.yaml to .gitignore.

The script will now generate a .hlint.yaml using .hlint.template.yaml as the template.


To work around this, you may run the script `./scripts/reconfigure-hlint.sh` to generate a `.hlint.yaml`
file with HLINT ignore rules derived from the source code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some documentation.

@newhoggy
Copy link
Contributor Author

bors merge

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jun 18, 2021

@iohk-bors iohk-bors bot merged commit b394805 into master Jun 18, 2021
@iohk-bors iohk-bors bot deleted the sync-hlint-rules branch June 18, 2021 09:57
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

Successfully merging this pull request may close these issues.

2 participants