Skip to main content

A lint framework that writes better Python code for you.

Project description

Fixit

Documentation

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:

tox -e py37

You can also run individual tests by using unittest and specifying a module like this:

python -m unittest fixit.common.testing.LintRuleTest

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fixit-0.1.0.tar.gz (74.3 kB view details)

Uploaded Source

Built Distribution

fixit-0.1.0-py3-none-any.whl (111.5 kB view details)

Uploaded Python 3

File details

Details for the file fixit-0.1.0.tar.gz.

File metadata

  • Download URL: fixit-0.1.0.tar.gz
  • Upload date:
  • Size: 74.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.3 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.5

File hashes

Hashes for fixit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 83c3d5fe1eed7c34eb7b6c5c683b628c2023e476eb9927c3d6629dec0e0ee5b3
MD5 622dad4b25fb314a28c8235ad73b98fc
BLAKE2b-256 cbbc57bfca81e4a56483308ac9a64fdaa9dd32fab2951ef01390faf908e27626

See more details on using hashes here.

File details

Details for the file fixit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fixit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 111.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.3 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.5

File hashes

Hashes for fixit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ed9e06a23c03daa0cde32d3f78a3c810bcca4bf08305f98893e75d4411b68f1
MD5 ac85c1a9ea07acdff94690d2cdfe2dc4
BLAKE2b-256 9a25e6bd6832a9748a8ff274d08fb776f19ef185254158a54251a03044a4cae2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page