https://github.com/meanmail-dev/flake8-local-import
Python 3 check local import for flake8
https://github.com/meanmail-dev/flake8-local-import
flake8 import plugin pypi python
Last synced: about 1 year ago
JSON representation
Python 3 check local import for flake8
- Host: GitHub
- URL: https://github.com/meanmail-dev/flake8-local-import
- Owner: meanmail-dev
- License: mit
- Created: 2020-08-16T09:02:38.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-10-28T09:30:03.000Z (over 4 years ago)
- Last Synced: 2024-11-05T07:19:58.075Z (over 1 year ago)
- Topics: flake8, import, plugin, pypi, python
- Language: Python
- Homepage: https://meanmail.dev
- Size: 22.5 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
# flake8-local-import
[](https://pepy.tech/project/flake8-local-import)




Python 3 check local import for flake8
# Installation
```bash
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
```python3
# 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/