Registry / testing / flake8-coding

flake8-coding

JSON →
library1.3.2pypypiunverified

Flake8 plugin that checks for a proper Python coding magic comment (e.g., # -*- coding: utf-8 -*-) at the top of files. Version 1.3.2 is the latest release as of 2021, with no active development.

pip install flake8-coding
INSTALL
IMPORT
SIG · FLAKE8-CODING
F
flake8-coding
testingpythonv1.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Install the plugin and run flake8 with the coding checks enabled (C101, C102, C103).

pip install flake8-coding flake8 --select=C101,C102,C103 your_file.py
Debug
Known issues
deprecatedPython 3 no longer requires coding magic comments (default is UTF-8). Many projects consider this check outdated.
fix
Consider if you still need this check; use `--ignore=C101` to suppress.
affects: 1.3.2
gotchaThe plugin only activates if you explicitly select the C1xx error codes. It is not enabled by default.
fix
Run flake8 with `--select=C1` or include in your flake8 config: `select = C1`.
affects: 1.3.2
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'flake8_coding'
Importing the plugin directly instead of as a flake8 plugin.
fix
Do not import flake8_coding in your code. It is auto-discovered by flake8 when installed.
flake8: error: unrecognized arguments: --select=C101
--select is a flake8 option, but using it before a file may cause confusion with older versions.
fix
Use `flake8 --select=C101 myfile.py` or add `select = C101` in .flake8 config.
Upgrade
Version history
1.3.2latest on PyPI · released Jun 16, 2019
Audit
Dependencies
flake8requiredrequired plugin host
Agent activity
4 hits · last 30 days
node
4
Resources
flake8-coding — pip install flake8-coding · libregistry