flake8 plugin that integrates isort .
Flake8 meet isort
Use isort to check if the imports on your python files are sorted the way you expect.
Add an .isort.cfg to define how you want your imports sorted and run flake8 as you usually do.
See isort documentation for .isort.cfg available options.
Install with pip:
$ pip install flake8-isort
Install with conda:
$ conda install -c conda-forge flake8-isort
If using the select option from flake8 be sure to enable the I category as well, see below for the specific error codes reported by flake8-isort.
|I001||isort found an import in the wrong position|
|I002||no configuration found (.isort.cfg or [isort] in configs)|
|I003||isort expected 1 blank line in imports, found 0|
|I004||isort found an unexpected blank line in imports|
|I005||isort found an unexpected missing import|
- Python 2.7, 3.5, 3.6, pypy or pypy3
Relation to flake8-import-order
As an alternative to this flake8 plugin, there’s flake8-import-order that could be worth checking out. In contrast to this plugin that defers all logic to isort, the flake8-import-order comes bundled with it’s own logic.
flake8-import-order comes with a few predefined set of styles meanwhile this plugin can be customized a bit more. But the biggest difference could lie in that flake8-isort actually has the corresponding sorting engine isort that can sort the import orders of your existing python files. Meanwhile flake8-import-order has no such corresponding tool, hence big existing projects who want to adopt either would get a more automized experience choosing flake8-isort.
- Fix compatibility with flake8 version 5. [nhymxu]
- Release it as a wheel as well. [gforcada]
- The package no longer depends on testfixtures.
- Release py3 only wheels..
- Support flake8 4.x [g-as]
- Switch from travis-ci to github actions. [g-as]
- Drop python 2.7 support and 3.5 as well [g-as]
- Nothing changed yet.
- support isort >= 5 [bnavigator, pkolbus]
- Work around FailedToLoadPlugin exception by requiring isort 4.x. Likewise, pin the major version of all dependencies, to reduce risk of any future incompatibilities. [pkolbus]
- Let isort search the configuration, rather than flake8-isort try to find it. [jnns]
- Fix flake8 warning. [sobolevn]
- Add python3.8 support. [sobolevn]
- Look for isort configuration on .flake8 files as well. [JohnHBrock]
- Document how to install flake8-isort on conda. [marcelotrevisani]
- Look for isort configuration on pyproject.toml files as well. [sanjioh]
- Improve the README. [barbossa]
- Fix isort output when pipes are used. [maerteijn]
- Use pytest to run tests. [gforcada]
- New error code I005 isort foundan unexpected missing import. [charettes]
- Add isort_show_traceback option to show verbose multi-line output from isort, turned off by default [sobolevn]
- Now requires isort >= 4.3.0. [jleclanche]
- Fix input handling with flake8’s –stdin-display-name, and simplify it. [blueyed]
- Remove flake8-polyfill dependency. flake8 >= 3.2.1 is required already, and stdin is not read directly anymore. [blueyed]
- Fix typo. [paltman]
- Add tox.ini and .editorconfig to config search. [cas–]
- Make this plugin compatible with flake8 hook. As the hook copies the files out of tree, flake8-isort never finds the correct configuration. [jaysonsantos]
- Workaround for isort bug when skipping files. [danpalmer]
- Release as universal wheel. [gforcada]
- Support flake8 git hook. [sergio-alonso]
- Support python 3.6. [gforcada]
- Search configuration on home folder. [gforcada]
- Fix yet another corner case. [gforcada]
- Fix another corner case: ignored files. [cas–]
- Fix corner cases of isort: newlines and grouped imports. [cas–]
- Show the exact line and kind of error, rather than a generic message. [cas–]
- Update trove classifiers. [gforcada]
- Add flake8 classifier. [sigmavirus24]
- Require flake8 3.2.1. flake8 series 3.1.x and 3.2.0 where not reporting flake8-isort errors. [gforcada]
- Test on pypy and pypy3. [gforcada]
- Fix tests and formatting. [gforcada]
- Fix standard input processing. [carljm]
- Refactor code to handle flake8 version 3. [danpalmer]
- Require flake8 version 3.0. [gforcada]
- Make error messages clearer. [do3cc]
- Use either pep8 or pycodestyle (new name for pep8). [Maxim Novikov]
- Fix coveralls. [gforcada]
- Allow stdin processing, this way text editor can pass input to flake8. [mjacksonw]
- Silence isort messages. [gforcada]
- Improve wording. [gforcada]
- Check for isort configuration on setup.cfg as well. [plumdog]
- Check for an isort configuration file. [gforcada]
- Fix entry point. [gforcada]
- Release wheels as well. [gforcada]
- Initial release [gforcada]
- Add all boilerplate files. [gforcada]
- Create the flake8 plugin per se. [gforcada]
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for flake8_isort-4.2.0-py3-none-any.whl