A lint framework that writes better Python code for you.
Fixit is a lint framework that complements Flake8. It’s based on LibCST which makes it possible to provide auto-fixes. Lint rules are made easy to build through pattern matching, a test toolkit, and utility helpers (e.g. scope analysis) for non-trivial boilerplate. It is optimized for efficiency, easy to customize and comes with many builtin lint rules.
Getting Started
To install Fixit:
pip install fixit
Fixit provides CLI commands. To run built-in Fixit rules on existing code to get code quality suggestions:
python -m fixit.cli.run_rules
To apply autofix on existing code:
python -m fixit.cli.apply_fix
You can learn more about how to configure Fixit, build a lint rule, test a lint rule from our tutorials. Try it out with our notebook examples.
Further Reading
Development
Start by setting up and activating a virtualenv:
git clone git@github.com:Instagram/Fixit.git fixit
cd fixit
python3 -m venv ../fixit-env/ # just an example, put this wherever you want
source ../fixit-env/bin/activate
pip install --upgrade pip # optional, if you have an old system version of pip
pip install -r requirements.txt -r requirements-dev.txt
# If you're done with the virtualenv, you can leave it by running:
deactivate
We use isort and black to format code. To format changes to be conformant, run the following in the root:
tox -e autofix
To run all tests, you’ll need to install tox and do the following in the root: (use py37, py38 to choose from Python version 3.7 or 3.8):
tox -e py38
You can also run individual unit tests by specifying a module like this:
tox -e py38 -- fixit.common.tests.test_report
To run all test cases of a specific rule (e.g. NoInheritFromObjectRule):
tox -e py38 -- fixit.tests.NoInheritFromObjectRule
See the unittest documentation for more examples of how to run tests.
We use Pyre for type-checking. To verify types for the library, do the following in the root:
pyre --preserve-pythonpath check
To generate documentation, do the following in the root:
tox -e docs
License
Fixit is MIT licensed, as found in the LICENSE file.
Privacy Policy and Terms of Use
Metadata
Release files for fixit1 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fixit1-0.1.4.tar.gz | 97.8 kB | Without provenance | Details for fixit1-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fixit1-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for fixit1-0.1.4-py3-none-any.whl |
Total release size: 242.1 kB
Release files / fixit1-0.1.4.tar.gz
| Download URL | fixit1-0.1.4.tar.gz |
|---|---|
| Size | 97.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f91b44659586181ccce11e85f206b38b2bdef17a363fe8e89fdfb44aa2dbcbe3
|
|
BLAKE2b-256 checksum How to use checksums |
5aa7a2170058be7534baad1925c0e31724754a2d94ab3b853120dc6ce2a04a35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / fixit1-0.1.4-py3-none-any.whl
| Download URL | fixit1-0.1.4-py3-none-any.whl |
|---|---|
| Size | 144.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc294cb2763cd0ae1633228504a0082471d78129e84268bae13431754b032466
|
|
BLAKE2b-256 checksum How to use checksums |
2e2b5e5c5d024bfa3e092ec396acfbf418ae63d304f9b987c389e2fa109fa8f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for fixit1 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.