All Projects → spoqa → flake8-import-order-spoqa

spoqa / flake8-import-order-spoqa

Licence: GPL-3.0 license
Spoqa's import order style for flake8-import-order

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to flake8-import-order-spoqa

flake8-broken-line
🚨 Flake8 plugin to forbid backslashes (\) for line breaks
Stars: ✭ 85 (+466.67%)
Mutual labels:  lint, flake8
prettier-check
Check that all files match prettier code style.
Stars: ✭ 54 (+260%)
Mutual labels:  lint
lint-deps
Lint for unused or missing dependencies in your node.js projects. Customize with plugins or configuration.
Stars: ✭ 48 (+220%)
Mutual labels:  lint
folderslint
📁 Directory structure linter for JavaScript projects
Stars: ✭ 131 (+773.33%)
Mutual labels:  lint
litho-lint-rules
Lint rules for Litho by Facebook http://fblitho.com/
Stars: ✭ 14 (-6.67%)
Mutual labels:  lint
arcanist-linters
A collection of custom Arcanist linters
Stars: ✭ 64 (+326.67%)
Mutual labels:  lint
chart-testing-action
A GitHub Action to lint and test Helm charts
Stars: ✭ 139 (+826.67%)
Mutual labels:  lint
Angular-Gulp-Boilerplate
Clean but full-featured AngularJS boilerplate using Gulp workflow and best practices
Stars: ✭ 30 (+100%)
Mutual labels:  lint
HTML-Lint
A code quality bookmarklet and command-line tool
Stars: ✭ 20 (+33.33%)
Mutual labels:  lint
flake8-simplify
❄ A flake8 plugin that helps you to simplify code
Stars: ✭ 97 (+546.67%)
Mutual labels:  flake8
breakcheck
Backwards compatibility linter for Go.
Stars: ✭ 66 (+340%)
Mutual labels:  lint
google classroom
Google Classroom Data Pipeline
Stars: ✭ 17 (+13.33%)
Mutual labels:  flake8
lint
Linting and formatting for SAS® code
Stars: ✭ 16 (+6.67%)
Mutual labels:  lint
puppet-lint-security-plugins
Identify security issues in your Puppet code.
Stars: ✭ 20 (+33.33%)
Mutual labels:  lint
arduino-lint
Tool to check for problems with Arduino projects
Stars: ✭ 63 (+320%)
Mutual labels:  lint
jupyterlab-flake8
Jupyterlab python linter for notebooks and text files using flake8
Stars: ✭ 105 (+600%)
Mutual labels:  flake8
KaiZen-OpenApi-Parser
High-performance Parser, Validator, and Java Object Model for OpenAPI 3.x
Stars: ✭ 119 (+693.33%)
Mutual labels:  lint
relint
General purpose RegEx based file linter.
Stars: ✭ 33 (+120%)
Mutual labels:  lint
flake8-assertive
Flake8 unittest assert method checker
Stars: ✭ 30 (+100%)
Mutual labels:  flake8
jsonlint
JSON/CJSON/JSON5 parser, syntax & schema validator and pretty-printer with a command-line client, written in pure JavaScript.
Stars: ✭ 21 (+40%)
Mutual labels:  lint

flake8-import-order-spoqa

This extends flake8-import-order to implement Spoqa's import order convention. It basically follows PEP 8 with our some additional rules:

  • Standard libraries shouldn't be imported using from ... import ... statement. It's because standard libraries tend to use general terms like open. We instead use always qualified imports to eliminate name pollution:

    import sys  # Yes
    
    from sys import version_info  # No

    However, there are few exceptions like typing module. They can be imported in both ways:

    import typing
    from typing import Optional  # `from ... import ...` must be latter
  • All other than standard libraries should be imported using from ... import ... statement:

    from flask import Flask  # Yes
    
    import flask  # No
  • Deeper relative imports should go former. This rule makes consistent even when relative imports are rewritten as absolute imports.

    from ..deeper import former
    from ...deepest import later
  • Imported names are splited to three categories: CONSTANT_NAME, ClassName, and normal_names, and follow that order:

    from something import CONST_A, CONST_B, ClassA, ClassB, any_func, any_var

Usage

Install the flake8-import-order-spoqa using pip, and then specify --import-order-style=spoqa option. Or you can specify it on the config file as well:

[flake8]
import-order-style = spoqa

Because runtime extensible styles is introduced from flake-import-order 0.12, you need to install flake-import-order 0.12 or later.

Distribution

Written by Hong Minhee, and distributed under GPLv3 or later.

Changelog

Version 1.5.1

To be released.

Version 1.5.0

Released on August 31, 2018.

  • The dataclasses module, like typing, now can be imported without a qualifier (e.g., from dataclasses import ...).

Version 1.4.1

Released on August 6, 2018.

  • Python 3.7 can be supported by updating flake8-import-order to 0.18. See its changelog to know more about updates.

Version 1.4.0

Released on May 22, 2018.

  • Python 3.3 became no more supported.

Version 1.3.0

Released on February 12, 2018.

  • Older versions than flake8-import-order 0.17 are now unsupported. (Under the hood, since flake8-import-order 0.17 refactored their internals so that constants like IMPORT_3RD_PARTY, IMPORT_APP, IMPORT_APP_PACKAGE, IMPORT_APP_RELATIVE, and IMPORT_STDLIB are evolved to ImportType enum type, flake8-import-order-spoqa also became to follow that.) [#3]

Version 1.2.0

Released on November 27, 2017.

  • Older versions than flake8-import-order 0.16 are now unsupported. (Under the hood, since flake8-import-order 0.16 refactored their internals so that no more Style.check() method and Style.imports property exist, flake8-import-order-spoqa also became to follow that.)

Version 1.1.0

Released on October 31, 2017.

  • Older versions than flake8-import-order 0.14.2 are now unsupported.

Version 1.0.2

Released on October 31, 2017.

  • Fixed incompatibility with flake8-import-order 0.14.1 or higher.

Version 1.0.1

Released on July 15, 2017.

  • Fixed a bug that wrong order of names (e.g. from ... import second, first) had been not warned.

Version 1.0.0

Initial release. Released on February 12, 2017.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].