Skip to content

meanmail-dev/flake8-local-import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flake8-local-import

Downloads PyPI PyPI - Python Version PyPI - Wheel PyPI - Implementation

Python 3 check local import for flake8

Installation

pip install flake8-local-import

Configuration

You will want to set the app-import-names option to a comma separated list of names that should be considered local to your application. Note that relative imports are always considered local.

Example

#  Error
def func():
    statement

    from app_package import A   # LI100 Local import must be at the beginning of the method body


#  Error
def func():
    statement

    from app_package import A   # LI100 Local import must be at the beginning of the method body


# Good
def func():
    from app_package import A

    statement

Error codes

code description
LI100 Local import must be at the beginning of the method body
LI101 Packages from external modules should not be imported locally
LI102 Packages from standard modules should not be imported locally

Links

https://github.com/meanmail-dev/flake8-local-import

https://meanmail.dev/