flake8-copyright

raw JSON →
0.2.4 verified Fri May 01 auth: no python

A flake8 plugin that checks Python files for copyright notices in their header comments. Version 0.2.4; stable but low activity.

pip install flake8-copyright
error ModuleNotFoundError: No module named 'flake8_copyright'
cause The plugin is not installed or the import path is wrong.
fix
Run: pip install flake8-copyright
error flake8: error: unrecognized arguments: --copyright-check
cause The plugin is not loaded; flake8 doesn't know about the options.
fix
Ensure flake8-copyright is installed (pip list | grep flake8-copyright) and run flake8 again.
gotcha The plugin requires flake8 to be installed separately.
fix Install flake8: pip install flake8
gotcha Copyright regex uses Python re.match; it must match from the beginning of file.
fix Use a regex that starts matching from the first line, e.g., Copyright \d{4} MyCompany
gotcha The 'copyright-min-file-size' default is 10 bytes; files smaller than this are skipped.
fix Set copyright-min-file-size = 0 to check all files.

Configure flake8-copyright in .flake8 and run flake8.

echo '[flake8]
copyright-check = True
copyright-min-file-size = 0
copyright-regexp = Copyright .* MyCompany' > .flake8
flake8 your_code.py