Plugin for PyLint that checks if we import only modules or packages. Direct imports of classes, functions and constants are forbidden
Project description
How it works?
It marks importing anything but modules/packages as invalid with a message only-importing-modules-is-allowed. This adheres to Google’s Python style guide.
An example:
from functools import partial # invalid import functools # valid from some_module.some_subomdule import SomeClass # invalid from some_module import some_subomdule # valid
Why?
To not force people to manual check if something we imported is a module or not.
How to use it?
After installing a package just run pylint, appending pylint_google_style_guide_imports_enforcing to your –load-plugins option.
An example:
pylint my_cool_project --load-plugins=pylint_google_style_guide_imports_enforcing
or append it to your pylintrc file:
[MASTER] load-plugins=pylint_google_style_guide_imports_enforcing
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pylint_google_style_guide_imports_enforcing-1.2.0.tar.gz
.
File metadata
- Download URL: pylint_google_style_guide_imports_enforcing-1.2.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b6f1acf5e8cd6c557c73fd07b324756d4d72aa8a95f6aaf27c84a361caf86a5 |
|
MD5 | e8fe0c66384a476255b34e7e6b152932 |
|
BLAKE2b-256 | 794d0ddec11234778df5ca8f771bdb81b010941fc01dff8ceb893503bd5fb938 |