-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
server: make more use of hlint #6059
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…relude" This reverts commit 77f5337.
This PR should not touch |
0x777
reviewed
Oct 28, 2020
0x777
reviewed
Oct 28, 2020
Deploy preview for hasura-docs ready! Built with commit fa5fc48 |
0x777
approved these changes
Oct 28, 2020
tirumaraiselvan
approved these changes
Oct 28, 2020
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
#5957 added an hlint code quality checking phase to the CI. However, as described in that PR, we left many hints disabled, as they may be considered controversial. This PR re-enables a number of hints, hopefully in a non-controversial way. Future PRs will be checked against them.
Using the hlint "refactor" tool, I have also applied many of the changes suggested by hlint. However, this tool needs to be babysit somewhat: it can generate code that does not compile, such as the following instance of the "Redundant bracket" hint:
and it can remove comments, such as the following instance of the "Functor law" hint:
(lines starting with
-
are removed by hlint; lines starting with+
are added)I have gone through the code after hlint's refactoring was applied, to make sure not too strange code is generated. However, please do feel free to scrutinize the changes introduced by this PR. (Actually, the first commit in this PR, e09db0c, which only enables hlint hints, does not pass CI. This is due to a mistake in the way the hlint script is run, and I have implemented a fix for this as part of #6003 where I already encountered this.)
As a reminder, the fact that this PR both enables hints and implements them is a choice: #5957 only runs hlint on files that were changed by a PR.
Changelog
CHANGELOG.md
is updated with user-facing content relevant to this PR. If no changelog is required, then add theno-changelog-required
label.Affected components
Related Issues
Solution and Design
Steps to test and verify
Limitations, known bugs & workarounds
Server checklist
Catalog upgrade
Does this PR change Hasura Catalog version?
Metadata
Does this PR add a new Metadata feature?
GraphQL
Breaking changes