Fix8
Automatic fix for Python linting issues found by Flake8.
Fixes
F401: Unused imports are removed. (If doing so would create a blank line at the start of the file then the next line is also removed).C812,C813,C814,C815,C816: Trailing commas are addedFA100: Future annotation imports are added.LBL001: Leading blank lines are removed.
Install
pip install fix8
Configuration
Fix8 will only fix issues that flake8 finds, so your existing flake8 configuration (including which plugins you have installed) will determine what gets fixed.
Usage
fix8 wraps flake8, so takes the same arguments. The easist way to use it is
to pass the files or directories you want fixed directly to it:
fix8 project/ that.py this.py
Wrappers
If you have a large project you may want to wrap it, something like this:
fix8-local() {
git diff --name-only --diff-filter=d | grep '\.py$' | sort --unique | xargs --no-run-if-empty fix8
}
This can be paired with isort to do both fixes with a single command:
# Put these functions in your `.bashrc` or similar
run-py-local() {
git diff --name-only --diff-filter=d | grep '\.py$' | sort --unique | xargs --no-run-if-empty "$@"
}
fix8-local() {
run-py-local fix8 && run-py-local isort
}
# Usage is then just this, but will detect and fix any changes that might need fixing
$ fix8-local
Metadata
Release files for fix8 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fix8-0.1.9.tar.gz | 7.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fix8-0.1.9-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 15.3 kB
Release files / fix8-0.1.9.tar.gz
| Download URL | fix8-0.1.9.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
68e068b80d423b1c0e1ced6b15f241e99e875e8709d10f069a6c90af92081067
|
|
BLAKE2b-256 checksum How to use checksums |
5ccd37bc3dceb6c393f182fb5258cb52ed41481304da36edbb57035336ae9081
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / fix8-0.1.9-py2.py3-none-any.whl
| Download URL | fix8-0.1.9-py2.py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
3994ab4acb0193179e24f33e2d0e26c03133183b770bd6438f99aa291358cacc
|
|
BLAKE2b-256 checksum How to use checksums |
b0bc9fd88c677423c7457a74c22afe9dee895e8302029f9fff54ef011f3ca9d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|