Draft
Conversation
This file contains hidden or 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
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.
Add bare minimum linter
A linter checks for certain basic problems in code and a formatter can enforce those rules. These are some of the benefits of having a linter:
It's difficult to think of proper downsides to using a linter, other than the bother of having to run it before committing. Mentally that can be a bothersome step, that last bit of housekeeping that throws up tiny little problems as the last hurdle to clear.
Importantly, we should be able to agree on basic linting rules that makes our lives easier. It shouldn't be a question of whether we should integrate a linter, but how.
Linter configuration
The linter is configured in
ruff.toml, the following explains the couple of lines in there.Everything else (line length, whitespace, naming conventions, complexity) is ignored.
in test files, unused imports (F401) and unused variables (F841) are suppressed. Both are common and intentional in tests: imports are often pulled in to trigger side-effects or make fixtures available, and variables like result = some_call() are assigned just to assert they don't raise.
How to install and use
It's listed as a dev dependency. To install, run:
pip install -e .[test]To use ruff, run:
ruff checkCurrent results
Linting for E9 and F on the codebase currently results in:
This PR...
Developer Checklist
Developers should review and confirm each of these items before requesting review
constantsormessagesfilesdates)url_fornot hard-codeddevelopReviewer Checklist
Reviewers should review and confirm each of these items before approval
If there are multiple reviewers, this section should be duplicated for each reviewer
constantsormessagesfilesdates)url_fornot hard-codeddevelopTesting
List user test scripts that need to be run
List any non-unit test scripts that need to be run by reviewers
Deployment
What deployment considerations are there? (delete any sections you don't need)
Configuration changes
What configuration changes are included in this PR, and do we need to set specific values for production
Scripts
What scripts need to be run from the PR (e.g. if this is a report generating feature), and when (once, regularly, etc).
Migrations
What migrations need to be run to deploy this
Monitoring
What additional monitoring is required of the application as a result of this feature
New Infrastructure
What new infrastructure does this PR require (e.g. new services that need to run on the back-end).
Continuous Integration
What CI changes are required for this