Chore/lint implementation#49
Merged
Merged
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.
Context
Code formatting issues (whitespace, trailing spaces) were slipping into commits
and only getting caught by flake8 in CI — causing avoidable failed pipelines and
follow-up "style: fix" commits.
What
black(code formatter) andpre-committodevelopment.txt.pre-commit-config.yamlrunning black and flake8 as commit hooks[tool.black]config inpyproject.tomlwith line-length 120Why
With pre-commit installed, black and flake8 run automatically before every
commit. Formatting issues are fixed (or blocked) locally, so they never reach
CI. Black's line-length is aligned to 120 to match the existing flake8 config,
keeping both tools consistent.
How it works
pre-commithooks run ongit commit: black formats, then flake8 verifiespyproject.toml; flake8 reads the existing.flake8pre-commit installonce after cloning to activate the hooksHow to verify
Make a formatting error (e.g. trailing whitespace), stage it, and commit —
black fixes it and the commit is blocked until re-staged. Tested locally:
hooks fire correctly, black reformats, flake8 passes.