A Flake8 formatter that applies '# noqa: <errors>' annotations to flake8 violations found, helping to incrementally improve code quality.
Project description
Flake8 Scout Rule
The Scout Rule: Leave Your Code Better Than You Found It
We all strive to be good digital citizens, right? The Scout Rule is a simple idea: always leave your code cleaner than you found it.
But let's face it, dealing with legacy code can be a real pain. It might not follow best practices or have linting rules in place.
Introducing the Flake8 Scout Rule!
This handy tool is like a digital cleanup crew. It works in two steps:
- Finds the Mess: It runs
flake8to identify all the coding mistakes. - Adds a Note: It politely adds a
# noqa: <errors>comment next to each issue, basically saying, "Hey, future developer, this code needs some love."
Why Use It?
- Gentle Introduction to New Linting Rules: It doesn't force you to fix everything at once.
- Teamwork Makes the Dream Work: Your team can gradually clean up the code together.
- Easy to Use: No need to manually annotate files, this formatter is easy and does it for you.
How It Works:
- Configure Flake8: Set up Flake8 with the rules you want to enforce.
- Run the Flake8 Scout Rule Formatter: Let the Flake8 Scout Rule do its magic.
- Collaborate: Agree with your team that whenever someone touches a file with those # noqa comments, they'll take a moment to fix the underlying issues, if it makes sense to do so.
By following this approach, you can gradually improve your codebase, one commit at a time.
How to run
First install flake8 and flake8-scout-rule
pip install flake8 flake8-scout-rule
Then run flake8-scout-rule like this, as a flake8 formatter
flake8 --format=scout .
Note: The formatter is compatible with all valid Flake8 options. It is particularly beneficial to use this formatter with the --select and --ignore Flake8 options.
No prompt option
This option automatically update files with violations without prompting the user to review the violations.
flake8 --format=scout --no-prompt .
License
Free software: MIT License
Credits
This package was created by Zach Attas aka snackattas, but couldn't have been possible without flake8!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flake8_scout_rule-1.0.1.tar.gz.
File metadata
- Download URL: flake8_scout_rule-1.0.1.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7b921859c5ba5a7f81a95ab926a2c7fb2300d4ac15d61ae9f74fb0555e2bd0a
|
|
| MD5 |
623372fadb0436084544def9c578619d
|
|
| BLAKE2b-256 |
927433ca9efa452dc0af9c695d10d700f1d91f50a16de3b6102ff856a3b0ba25
|
File details
Details for the file flake8_scout_rule-1.0.1-py3-none-any.whl.
File metadata
- Download URL: flake8_scout_rule-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fb896b7324b6030a85353d58211c4b4fcfa04e01bd684c45e829d8c5ba3a6b0
|
|
| MD5 |
1a0b1f2bfc9ba251fc16534bcd428e9d
|
|
| BLAKE2b-256 |
10d48b13780779cc17353bd195d2284fc94bbaa5dbaee0304c3b998bc2561329
|