Skip to main content

flake8 plugin that integrates isort .

Project description

https://travis-ci.org/gforcada/flake8-isort.svg?branch=master https://coveralls.io/repos/gforcada/flake8-isort/badge.svg?branch=master&service=github

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

Options

Since version 1.0 a check for an .isort.cfg file is done, since version 1.1 setup.cfg is also checked for an [isort] section.

This potentially avoids to lint a project that has no formal definition of how import should be sorted.

With either --no-isort-config command line switch, or no-isort-config flake8 configuration option it can be disabled.

Requirements

  • Python 2.7, 3.5, 3.6, pypy or 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

Changelog

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]

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

flake8-isort-2.3.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flake8_isort-2.3-py2.py3-none-any.whl (8.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file flake8-isort-2.3.tar.gz.

File metadata

  • Download URL: flake8-isort-2.3.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for flake8-isort-2.3.tar.gz
Algorithm Hash digest
SHA256 6a5716ddf5575b5623f3e124f5662982d33fc9f4f5abda97d490cbcc8936ce33
MD5 9b76e89d2b8ab874e3f851b4096df0f2
BLAKE2b-256 6e30b00b68f34c9b9b22b89e2c1a82f8aab75e0f16f12ae2770912f52ab71624

See more details on using hashes here.

File details

Details for the file flake8_isort-2.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for flake8_isort-2.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5faacab560fe1a6b0b2a35d1ef97064a2c227cf34fa46d189a59a1b1c799296d
MD5 28b67a57d0fb2baaf77eef0055dac35d
BLAKE2b-256 c506fa0deb35ed53074b9e67119685df11fd8a8f0f592ca477bbde9bfbaf0a51

See more details on using hashes here.

Supported by

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