flake8 plugin which checks that modules under `__all__` are defined as strings
Project description
flake8-all-not-strings
Flake8 plugin that checks that the all the elements defined in the __all__
list are strings. Sometimes the flake8 doesn't throw error from the __init__.py
if the modules under __all__
are not strings.
Example below of an __init__.py
file which should throw an error:-
from some_module import some_function
__all__ = [
some_function
]
Example below of an __init__.py
file which should not throw an error:-
from some_module import some_function
__all__ = [
'some_function'
]
Installation
pip install flake8-all-not-strings
Flake8 codes
Code | description |
---|---|
ANS100 | '<<some_module_name>>' import under all is not a string. |
Testing
In order to run unit tests under the tests/
directory you can do the following steps:-
Install editable version of flake8-all-not-strings
from the top level directory
pip install -e .
Install pytest
pip install pytest
Run tests
Change to tests/
directory and run tests using pytest
cd tests/
pytest
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
Built Distribution
Close
Hashes for flake8_all_not_strings-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ab740ee0da954b5e4e5d0913e4f1075ec209a896446e44669cccf1f64a02476 |
|
MD5 | d77eadb7ef1fe6b68b6a8c62f80b945d |
|
BLAKE2b-256 | ac45c0c4c3be52c8abd1e7623f1c1502a7d2ae43c96ce6e890856f60dfd9a867 |
Close
Hashes for flake8_all_not_strings-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2a1b38533692fda1b1f00a11d8e7351e330ea251b162cdbc27b7b43ee2b5619 |
|
MD5 | 1b59dc656d0329bb431535ce8886e1fd |
|
BLAKE2b-256 | e3e18bb6bbcdcfa169a29f50e53ec3b1a34b621aa42f5020642cfbda7cf8b918 |