Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ggupta2005/flake8-all-not-strings
flake8 plugin which checks that modules under `__all__` are defined as strings
https://github.com/ggupta2005/flake8-all-not-strings
flake8 linting python
Last synced: 3 months ago
JSON representation
flake8 plugin which checks that modules under `__all__` are defined as strings
- Host: GitHub
- URL: https://github.com/ggupta2005/flake8-all-not-strings
- Owner: ggupta2005
- License: mit
- Created: 2023-06-23T22:54:12.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-18T20:39:54.000Z (7 months ago)
- Last Synced: 2024-05-16T01:35:09.652Z (6 months ago)
- Topics: flake8, linting, python
- Language: Python
- Homepage:
- Size: 48.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-flake8-extensions - flake8-all-not-strings - Checks that if modules under `__all__` are defined as strings. (Clean code)
README
# flake8-all-not-strings
![PyPI data-understand](https://img.shields.io/pypi/v/flake8-all-not-strings)
![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)
![versions](https://img.shields.io/pypi/pyversions/flake8-all-not-strings)
![Downloads](https://static.pepy.tech/badge/flake8-all-not-strings)[![Python Linting](https://github.com/ggupta2005/flake8-all-not-strings/actions/workflows/python-linting.yml/badge.svg)](https://github.com/ggupta2005/flake8-all-not-strings/actions/workflows/python-linting.yml)
[![Run Python Unit Tests](https://github.com/ggupta2005/flake8-all-not-strings/actions/workflows/python-unit-tests.yml/badge.svg)](https://github.com/ggupta2005/flake8-all-not-strings/actions/workflows/python-unit-tests.yml)[![CodeFactor](https://www.codefactor.io/repository/github/ggupta2005/flake8-all-not-strings/badge)](https://www.codefactor.io/repository/github/ggupta2005/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 | '<>' import under __all__ is not a string. |