.. -*- coding: utf-8 -*-
.. image:: https://github.com/gforcada/flake8-isort/actions/workflows/testing.yml/badge.svg?branch=master
:target: https://github.com/gforcada/flake8-isort/actions/workflows/testing.yml
.. image:: https://coveralls.io/repos/gforcada/flake8-isort/badge.svg?branch=master
:target: https://coveralls.io/github/gforcada/flake8-isort?branch=master
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
-------
Install with pip::
$ pip install flake8-isort
Install with conda::
$ conda install -c conda-forge flake8-isort
Configuration
-------------
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`.
See ``flake8 --help`` for available flake8-isort options.
Error codes
-----------
+------------+-----------------------------------------------------------+
| Error code | Description |
+============+===========================================================+
| 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 |
+------------+-----------------------------------------------------------+
Requirements
------------
- Python 3.8, 3.9, 3.10, 3.11 and pypy3
- flake8
- isort
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.
License
-------
GPL 2.0
.. _`isort`: https://pypi.python.org/pypi/isort
.. _`isort documentation`: https://pycqa.github.io/isort/docs/configuration/options.html
.. _`flake8-import-order`: https://pypi.python.org/pypi/flake8-import-order
.. _`option from flake8`: http://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-select
.. -*- coding: utf-8 -*-
Changelog
=========
6.1.0 (2023-09-15)
------------------
- Drop python 3.7 support.
[gforcada]
- Add preliminary support to Python 3.12.
[gforcada]
6.0.0 (2022-12-22)
------------------
- Drop isort 4.x support.
[gforcada]
- Add support for flake8 6.0.0.
[gforcada]
- Add `--isort-no-skip-gitignore` option to allow temporarily overriding the set
value of isort's `skip_gitignore` option with `False`. This can cause
flake8-isort to run significantly faster at the cost of making flake8-isort's
behavior differ slightly from the behavior of `isort --check`. [gschaffner]
5.0.3 (2022-11-20)
------------------
- Fix broken `add_options` method, again. [casperdcl]
5.0.2 (2022-11-19)
------------------
- Fix broken `add_options` method [casperdcl]
5.0.1 (2022-11-18)
------------------
- Improve the config option is added and read back. [gforcada]
- Bump plugin version. [gforcada]
5.0.0 (2022-10-08)
------------------
- Update dependencies. [gforcada]
- Revamp GitHub actions. [gforcada]
- Drop python 3.6, and add python 3.10. [gforcada]
- Use linters and formatters to keep code sane and beautiful. [gforcada]
4.2.0 (2022-08-04)
------------------
- Fix compatibility with flake8 version 5. [nhymxu]
4.1.2.post0 (2022-07-25)
------------------------
- Release it as a wheel as well. [gforcada]
4.1.2 (2022-07-25)
------------------
- The package no longer depends on ``testfixtures``.
4.1.1 (2021-10-14)
------------------
- Release py3 only wheels..
4.1.0 (2021-10-14)
------------------
- 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]
4.0.0 (2020-08-11)
------------------
- Nothing changed yet.
4.0.0a0 (2020-08-07)
--------------------
- support isort >= 5 [bnavigator, pkolbus]
3.0.1 (2020-07-08)
------------------
- 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]
3.0.0 (2020-04-15)
------------------
- Let `isort` search the configuration, rather than `flake8-isort` try to find it.
[jnns]
2.9.1 (2020-03-28)
------------------
- Fix flake8 warning.
[sobolevn]
2.9.0 (2020-03-16)
------------------
- Add ``python3.8`` support.
[sobolevn]
2.8.0 (2019-12-05)
------------------
- 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]
2.7.0 (2019-03-19)
------------------
- Improve the README.
[barbossa]
- Fix isort output when pipes are used.
[maerteijn]
2.6.0 (2018-12-01)
------------------
- 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]
2.5 (2018-03-15)
----------------
- Now requires isort >= 4.3.0.
[jleclanche]
2.4 (2018-02-25)
----------------
- 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]
2.3 (2017-12-22)
----------------
- 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]
2.2.2 (2017-08-19)
------------------
- Workaround for isort bug when skipping files.
[danpalmer]
2.2.1 (2017-05-12)
------------------
- Release as universal wheel.
[gforcada]
2.2 (2017-03-26)
----------------
- Support flake8 git hook.
[sergio-alonso]
- Support python 3.6.
[gforcada]
- Search configuration on home folder.
[gforcada]
2.1.3 (2016-11-25)
------------------
- Fix yet another corner case.
[gforcada]
2.1.2 (2016-11-25)
------------------
- Fix another corner case: ignored files.
[cas--]
2.1.1 (2016-11-25)
------------------
- Fix corner cases of isort: newlines and grouped imports.
[cas--]
2.1.0 (2016-11-24)
------------------
- Show the exact line and kind of error,
rather than a generic message.
[cas--]
2.0.3 (2016-11-22)
------------------
- Update trove classifiers.
[gforcada]
2.0.2 (2016-11-22)
------------------
- 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]
2.0.1 (2016-09-22)
------------------
- Fix standard input processing.
[carljm]
2.0 (2016-09-14)
----------------
- Refactor code to handle flake8 version 3.
[danpalmer]
- Require flake8 version 3.0.
[gforcada]
1.3 (2016-06-20)
----------------
- Make error messages clearer.
[do3cc]
- Use either pep8 or pycodestyle (new name for pep8).
[Maxim Novikov]
- Fix coveralls.
[gforcada]
1.2 (2016-03-05)
----------------
- Allow stdin processing, this way text editor can pass input to flake8.
[mjacksonw]
1.1.1 (2016-02-16)
------------------
- Silence isort messages.
[gforcada]
- Improve wording.
[gforcada]
1.1 (2016-02-16)
----------------
- Check for isort configuration on setup.cfg as well.
[plumdog]
1.0 (2015-12-16)
----------------
- Check for an isort configuration file.
[gforcada]
0.2 (2015-09-14)
----------------
- Fix entry point.
[gforcada]
0.1.post0 (2015-09-13)
----------------------
- Release wheels as well.
[gforcada]
0.1 (2015-09-13)
----------------
- Initial release
[gforcada]
- Add all boilerplate files.
[gforcada]
- Create the flake8 plugin per se.
[gforcada]
Raw data
{
"_id": null,
"home_page": "https://github.com/gforcada/flake8-isort",
"name": "flake8-isort",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "pep8 flake8 python isort imports",
"author": "Gil Forcada",
"author_email": "gil.gnome@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b8/4c/4ad674a3fbb0e2ccd042cd824e0040f9a1c19cfde27a020f255adf58f481/flake8-isort-6.1.0.tar.gz",
"platform": null,
"description": "\n.. -*- coding: utf-8 -*-\n\n.. image:: https://github.com/gforcada/flake8-isort/actions/workflows/testing.yml/badge.svg?branch=master\n :target: https://github.com/gforcada/flake8-isort/actions/workflows/testing.yml\n\n.. image:: https://coveralls.io/repos/gforcada/flake8-isort/badge.svg?branch=master\n :target: https://coveralls.io/github/gforcada/flake8-isort?branch=master\n\nFlake8 meet isort\n=================\nUse `isort`_ to check if the imports on your python files are sorted the way you expect.\n\nAdd an ``.isort.cfg`` to define how you want your imports sorted and run flake8 as you usually do.\n\nSee `isort documentation`_ for ``.isort.cfg`` available options.\n\nInstall\n-------\nInstall with pip::\n\n $ pip install flake8-isort\n\nInstall with conda::\n\n $ conda install -c conda-forge flake8-isort\n\n\nConfiguration\n-------------\nIf 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`.\n\nSee ``flake8 --help`` for available flake8-isort options.\n\nError codes\n-----------\n+------------+-----------------------------------------------------------+\n| Error code | Description |\n+============+===========================================================+\n| I001 | isort found an import in the wrong position |\n+------------+-----------------------------------------------------------+\n| I002 | no configuration found (.isort.cfg or [isort] in configs) |\n+------------+-----------------------------------------------------------+\n| I003 | isort expected 1 blank line in imports, found 0 |\n+------------+-----------------------------------------------------------+\n| I004 | isort found an unexpected blank line in imports |\n+------------+-----------------------------------------------------------+\n| I005 | isort found an unexpected missing import |\n+------------+-----------------------------------------------------------+\n\nRequirements\n------------\n- Python 3.8, 3.9, 3.10, 3.11 and pypy3\n- flake8\n- isort\n\nRelation to flake8-import-order\n-------------------------------\n\nAs 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.\n\nflake8-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.\n\nLicense\n-------\nGPL 2.0\n\n.. _`isort`: https://pypi.python.org/pypi/isort\n.. _`isort documentation`: https://pycqa.github.io/isort/docs/configuration/options.html\n.. _`flake8-import-order`: https://pypi.python.org/pypi/flake8-import-order\n.. _`option from flake8`: http://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-select\n\n.. -*- coding: utf-8 -*-\n\nChangelog\n=========\n\n6.1.0 (2023-09-15)\n------------------\n\n- Drop python 3.7 support.\n [gforcada]\n\n- Add preliminary support to Python 3.12.\n [gforcada]\n\n6.0.0 (2022-12-22)\n------------------\n\n- Drop isort 4.x support.\n [gforcada]\n\n- Add support for flake8 6.0.0.\n [gforcada]\n\n- Add `--isort-no-skip-gitignore` option to allow temporarily overriding the set\n value of isort's `skip_gitignore` option with `False`. This can cause\n flake8-isort to run significantly faster at the cost of making flake8-isort's\n behavior differ slightly from the behavior of `isort --check`. [gschaffner]\n\n5.0.3 (2022-11-20)\n------------------\n\n- Fix broken `add_options` method, again. [casperdcl]\n\n5.0.2 (2022-11-19)\n------------------\n\n- Fix broken `add_options` method [casperdcl]\n\n5.0.1 (2022-11-18)\n------------------\n\n- Improve the config option is added and read back. [gforcada]\n\n- Bump plugin version. [gforcada]\n\n5.0.0 (2022-10-08)\n------------------\n\n- Update dependencies. [gforcada]\n\n- Revamp GitHub actions. [gforcada]\n\n- Drop python 3.6, and add python 3.10. [gforcada]\n\n- Use linters and formatters to keep code sane and beautiful. [gforcada]\n\n4.2.0 (2022-08-04)\n------------------\n\n- Fix compatibility with flake8 version 5. [nhymxu]\n\n\n4.1.2.post0 (2022-07-25)\n------------------------\n\n- Release it as a wheel as well. [gforcada]\n\n\n4.1.2 (2022-07-25)\n------------------\n\n- The package no longer depends on ``testfixtures``. \n\n\n4.1.1 (2021-10-14)\n------------------\n\n- Release py3 only wheels..\n\n\n4.1.0 (2021-10-14)\n------------------\n\n- Support flake8 4.x [g-as]\n\n- Switch from travis-ci to github actions. [g-as]\n\n- Drop python 2.7 support and 3.5 as well [g-as]\n\n\n4.0.0 (2020-08-11)\n------------------\n\n- Nothing changed yet.\n\n\n4.0.0a0 (2020-08-07)\n--------------------\n\n- support isort >= 5 [bnavigator, pkolbus]\n\n\n3.0.1 (2020-07-08)\n------------------\n\n- Work around `FailedToLoadPlugin` exception by requiring `isort` 4.x. Likewise,\n pin the major version of all dependencies, to reduce risk of any future\n incompatibilities.\n [pkolbus]\n\n\n3.0.0 (2020-04-15)\n------------------\n\n- Let `isort` search the configuration, rather than `flake8-isort` try to find it.\n [jnns]\n\n2.9.1 (2020-03-28)\n------------------\n\n- Fix flake8 warning.\n [sobolevn]\n\n2.9.0 (2020-03-16)\n------------------\n\n- Add ``python3.8`` support.\n [sobolevn]\n\n2.8.0 (2019-12-05)\n------------------\n\n- Look for isort configuration on `.flake8` files as well.\n [JohnHBrock]\n\n- Document how to install `flake8-isort` on conda.\n [marcelotrevisani]\n\n- Look for isort configuration on `pyproject.toml` files as well.\n [sanjioh]\n\n2.7.0 (2019-03-19)\n------------------\n\n- Improve the README.\n [barbossa]\n\n- Fix isort output when pipes are used.\n [maerteijn]\n\n2.6.0 (2018-12-01)\n------------------\n\n- Use pytest to run tests.\n [gforcada]\n\n- New error code I005 isort foundan unexpected missing import.\n [charettes]\n\n- Add ``isort_show_traceback`` option to show verbose multi-line output\n from ``isort``, turned off by default\n [sobolevn]\n\n2.5 (2018-03-15)\n----------------\n\n- Now requires isort >= 4.3.0.\n [jleclanche]\n\n\n2.4 (2018-02-25)\n----------------\n\n- Fix input handling with flake8's --stdin-display-name, and simplify it.\n [blueyed]\n\n- Remove flake8-polyfill dependency. flake8 >= 3.2.1 is required already, and\n stdin is not read directly anymore.\n [blueyed]\n\n2.3 (2017-12-22)\n----------------\n\n- Fix typo.\n [paltman]\n\n- Add tox.ini and .editorconfig to config search.\n [cas--]\n\n- Make this plugin compatible with flake8 hook.\n As the hook copies the files out of tree,\n flake8-isort never finds the correct configuration.\n [jaysonsantos]\n\n2.2.2 (2017-08-19)\n------------------\n\n- Workaround for isort bug when skipping files.\n [danpalmer]\n\n2.2.1 (2017-05-12)\n------------------\n\n- Release as universal wheel.\n [gforcada]\n\n2.2 (2017-03-26)\n----------------\n\n- Support flake8 git hook.\n [sergio-alonso]\n\n- Support python 3.6.\n [gforcada]\n\n- Search configuration on home folder.\n [gforcada]\n\n2.1.3 (2016-11-25)\n------------------\n\n- Fix yet another corner case.\n [gforcada]\n\n2.1.2 (2016-11-25)\n------------------\n\n- Fix another corner case: ignored files.\n [cas--]\n\n2.1.1 (2016-11-25)\n------------------\n\n- Fix corner cases of isort: newlines and grouped imports.\n [cas--]\n\n2.1.0 (2016-11-24)\n------------------\n\n- Show the exact line and kind of error,\n rather than a generic message.\n [cas--]\n\n2.0.3 (2016-11-22)\n------------------\n\n- Update trove classifiers.\n [gforcada]\n\n2.0.2 (2016-11-22)\n------------------\n\n- Add flake8 classifier.\n [sigmavirus24]\n\n- Require flake8 3.2.1.\n flake8 series 3.1.x and 3.2.0 where not reporting flake8-isort errors.\n [gforcada]\n\n- Test on pypy and pypy3.\n [gforcada]\n\n- Fix tests and formatting.\n [gforcada]\n\n2.0.1 (2016-09-22)\n------------------\n\n- Fix standard input processing.\n [carljm]\n\n\n2.0 (2016-09-14)\n----------------\n\n- Refactor code to handle flake8 version 3.\n [danpalmer]\n\n- Require flake8 version 3.0.\n [gforcada]\n\n1.3 (2016-06-20)\n----------------\n\n- Make error messages clearer.\n [do3cc]\n\n- Use either pep8 or pycodestyle (new name for pep8).\n [Maxim Novikov]\n\n- Fix coveralls.\n [gforcada]\n\n1.2 (2016-03-05)\n----------------\n- Allow stdin processing, this way text editor can pass input to flake8.\n [mjacksonw]\n\n1.1.1 (2016-02-16)\n------------------\n- Silence isort messages.\n [gforcada]\n\n- Improve wording.\n [gforcada]\n\n1.1 (2016-02-16)\n----------------\n- Check for isort configuration on setup.cfg as well.\n [plumdog]\n\n1.0 (2015-12-16)\n----------------\n- Check for an isort configuration file.\n [gforcada]\n\n0.2 (2015-09-14)\n----------------\n- Fix entry point.\n [gforcada]\n\n0.1.post0 (2015-09-13)\n----------------------\n- Release wheels as well.\n [gforcada]\n\n0.1 (2015-09-13)\n----------------\n- Initial release\n [gforcada]\n\n- Add all boilerplate files.\n [gforcada]\n\n- Create the flake8 plugin per se.\n [gforcada]\n\n",
"bugtrack_url": null,
"license": "GPL version 2",
"summary": "flake8 plugin that integrates isort .",
"version": "6.1.0",
"project_urls": {
"Homepage": "https://github.com/gforcada/flake8-isort"
},
"split_keywords": [
"pep8",
"flake8",
"python",
"isort",
"imports"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b84c4ad674a3fbb0e2ccd042cd824e0040f9a1c19cfde27a020f255adf58f481",
"md5": "cc3c71127c099eaf479e7dcc18c3981f",
"sha256": "d4639343bac540194c59fb1618ac2c285b3e27609f353bef6f50904d40c1643e"
},
"downloads": -1,
"filename": "flake8-isort-6.1.0.tar.gz",
"has_sig": false,
"md5_digest": "cc3c71127c099eaf479e7dcc18c3981f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 16432,
"upload_time": "2023-09-15T17:36:55",
"upload_time_iso_8601": "2023-09-15T17:36:55.942058Z",
"url": "https://files.pythonhosted.org/packages/b8/4c/4ad674a3fbb0e2ccd042cd824e0040f9a1c19cfde27a020f255adf58f481/flake8-isort-6.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-15 17:36:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gforcada",
"github_project": "flake8-isort",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "flake8-isort"
}