https://github.com/community-of-python/flake8-plugin
Linter that bridges the gap between our code style and existing linters
https://github.com/community-of-python/flake8-plugin
Last synced: 25 days ago
JSON representation
Linter that bridges the gap between our code style and existing linters
- Host: GitHub
- URL: https://github.com/community-of-python/flake8-plugin
- Owner: community-of-python
- License: mit
- Created: 2026-02-03T13:51:36.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-06-10T09:02:34.000Z (about 1 month ago)
- Last Synced: 2026-06-10T11:05:59.256Z (about 1 month ago)
- Language: Python
- Size: 243 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Community of Python Flake8 Plugin
A Flake8 plugin that enforces the Community of Python's custom code style rules. This plugin provides a set of checks designed to promote consistent and idiomatic Python code within the community.
## Features
This plugin implements the following code style checks:
- **COP001**: Use module import when importing more than two names
- **COP002**: Import standard library modules as whole modules
- **COP003**: Avoid explicit scalar type annotations
- **COP004**: Attribute name must be at least 8 characters
- **COP005**: Variable name must be at least 8 characters
- **COP006**: Argument name must be at least 8 characters
- **COP007**: Function name must be at least 8 characters
- **COP008**: Class name must be at least 8 characters
- **COP009**: Function identifier must be a verb
- **COP010**: Avoid `get_` prefix in async function names
- **COP011**: Avoid temporary variables used only once
- **COP012**: Classes should be marked `typing.final`
- **COP013**: Wrap module dictionaries with `types.MappingProxyType`
- **COP014**: Use dataclasses with `kw_only=True`, `slots=True`, `frozen=True`
- **COP015**: For-loop variables must be prefixed with `one_`
- **COP016**: Add `*` or `/` when defining more than two regular arguments
## Installation
Install the plugin using `uv` (recommended):
```bash
uv add --dev community-of-python-flake8-plugin
```
Or install via pip:
```bash
pip install community-of-python-flake8-plugin
```
## Usage
Run Flake8 with the plugin enabled:
```bash
uv run flake8 --select COP --exclude .venv .
```
Or if installed globally:
```bash
flake8 --select COP --exclude .venv .
```
## Configuration
Add the following to your `pyproject.toml` when using https://pypi.org/project/Flake8-pyproject/:
```toml
[tool.flake8]
select = ["COP"]
exclude = [".venv"]
```