https://github.com/snackattas/flake8-scout-rule
A Flake8 formatter that applies '# noqa: <errors>' annotations to the flake8 violations found, helping to incrementally improve code quality.
https://github.com/snackattas/flake8-scout-rule
flake8 flake8-extensions flake8-plugin linting python python3 qa quality scout-rule
Last synced: about 1 month ago
JSON representation
A Flake8 formatter that applies '# noqa: <errors>' annotations to the flake8 violations found, helping to incrementally improve code quality.
- Host: GitHub
- URL: https://github.com/snackattas/flake8-scout-rule
- Owner: snackattas
- License: other
- Created: 2024-11-30T17:46:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-29T22:31:34.000Z (about 1 year ago)
- Last Synced: 2025-10-12T08:31:40.105Z (5 months ago)
- Topics: flake8, flake8-extensions, flake8-plugin, linting, python, python3, qa, quality, scout-rule
- Language: Python
- Homepage: https://pypi.org/project/flake8-scout-rule/
- Size: 186 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flake8 Scout Rule
[](https://badge.fury.io/py/flake8-scout-rule)
[](https://github.com/snackattas/flake8-scout-rule/actions/workflows/test.yml)
[](https://codecov.io/github/snackattas/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:
1. **Finds the Mess**: It runs `flake8` to identify all the coding mistakes.
2. **Adds a Note**: It politely adds a `# noqa: ` 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**:
1. **Configure Flake8**: Set up Flake8 with the rules you want to enforce.
2. **Run the Flake8 Scout Rule Formatter**: Let the Flake8 Scout Rule do its magic.
2. **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`
```commandline
pip install flake8 flake8-scout-rule
```
Then run `flake8-scout-rule` like this, as a flake8 formatter
```commandline
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.
```commandline
flake8 --format=scout --no-prompt .
```
# License
Free software: MIT License
# Credits
This package was created by Zach Attas aka [snackattas](https://github.com/snackattas), but couldn't have been possible without [flake8](https://github.com/PyCQA/flake8)!