Enforce f-string interpolation with Ruff#1088
Merged
Merged
Conversation
Member
|
I think the linting rule is fine, but I'm not a fan of pre-commit hooks. That maybe should be a team discussion on whether we adopt them. Can you drop the pre-commit hook, the lint rule is good as-is. Thanks! |
Member
|
pre-commit hooks just kinda get in the way when doing local dev imo. Correct place for linting enforcement is in ci/cd on PR. It has to be there anyway since pre-commit hooks are unenforceable. |
5901893 to
83eb899
Compare
- Adds a pre-commit hook for ungoing enforcement. - --force-exclude prevents generated migrations from causing problems.
83eb899 to
306f78f
Compare
Contributor
Author
|
I've amended to remove the pre-commit hooks. |
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.
What changed?
Adds rule to express that we prefer f-strings, enforcing it with pre-commit hook and CI.
Why?
Saves time in the peer-review process from accidentally not using them and then
having them flagged by a human and fixed.
Limitations and Notes
Devs need to each install the pre-commit hook:
Applicable Issues
Inspired by PR #1075, where I used non-f-strings in a few places, a mistake
which which likely to be completed by myself or other new contributors without
automation.