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
File details
Details for the file flake8_all_not_strings-0.0.2.tar.gz
.
File metadata
- Download URL: flake8_all_not_strings-0.0.2.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ab740ee0da954b5e4e5d0913e4f1075ec209a896446e44669cccf1f64a02476 |
|
MD5 | d77eadb7ef1fe6b68b6a8c62f80b945d |
|
BLAKE2b-256 | ac45c0c4c3be52c8abd1e7623f1c1502a7d2ae43c96ce6e890856f60dfd9a867 |
File details
Details for the file flake8_all_not_strings-0.0.2-py2.py3-none-any.whl
.
File metadata
- Download URL: flake8_all_not_strings-0.0.2-py2.py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2a1b38533692fda1b1f00a11d8e7351e330ea251b162cdbc27b7b43ee2b5619 |
|
MD5 | 1b59dc656d0329bb431535ce8886e1fd |
|
BLAKE2b-256 | e3e18bb6bbcdcfa169a29f50e53ec3b1a34b621aa42f5020642cfbda7cf8b918 |