Skip to content

KevinGreen/flake8-absolute-import

 
 

Repository files navigation

flake8-absolute-import

flake8 plugin to require absolute imports

Current Development Version:

https://img.shields.io/azure-devops/build/brianskinn/69156953-0c09-4122-8268-0cc35b259749/3?label=azure-pipelines&logo=azure-devops https://img.shields.io/travis/com/bskinn/flake8-absolute-import?label=travis-ci&logo=travis

Most Recent Stable Release:

https://img.shields.io/pypi/v/flake8-absolute-import.svg?logo=pypi

https://img.shields.io/pypi/pyversions/flake8-absolute-import.svg?logo=python

Info:


Don't like relative imports?

Lint 'em out!

flake8-absolute-import uses a simple check of the AST for each from x import y statement to flag relative imports. Specifically, it checks for a nonzero level attribute on each ImportFrom node.

Relative imports raise the ABS101 error code:

from foo import bar   # OK
from .foo import bar  # ABS101

Available on PyPI (pip install flake8-absolute-import). flake8 should automatically detect and load the plugin. flake8>=3.0 is required.

Source on GitHub. Bug reports and feature requests are welcomed at the Issues page there.

Copyright (c) Brian Skinn 2019-2020

License: The MIT License. See LICENSE.txt for full license terms.

About

flake8 plugin to require absolute imports

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%