flake8-coding

raw JSON →
1.3.2 verified Fri May 01 auth: no python maintenance

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
error ModuleNotFoundError: No module named 'flake8_coding'
cause 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.
error flake8: error: unrecognized arguments: --select=C101
cause --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.
deprecated Python 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.
gotcha The 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`.

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