PYCODESTYLE(1)
π PYCODESTYLE β bestie, your Python code is about to get read
okay so pycodestyle is that girl. she is a tool that checks your Python code against some of the style conventions in PEP 8. yes, the vibes-based document. she will look at your code and go "hmm. bestie. what is this." π
it's giving linting but make it fashion. no cap.
β¨ SYNOPSIS β¨
pycodestyle [options] input ...
that's it. that's the whole thing. options, then the stuff you want checked. periodt.
π OPTIONS π
okay this is the part where you pay attention. every single one, no skipping, I see you π
--versionβ shows the program's version number and then dips. that's it, that's all she does.-h,--helpβ shows this help message and exits. the classic "what do I do" button. π«Ά-v,--verboseβ prints status messages. add another one (-vv) and she goes full debug mode on you. double the v, double the tea. β-q,--quietβ reports only file names. and with-qq? reports nothing. silence. iconic. π€«- *
--exclude=patterns* β nope out of files or directories matching these comma separated patterns. the default list is literally:.svn,CVS,.bzr,.hg,.git,__pycache__,.toxβ she does not want to see your__pycache__, she has boundaries. - *
--filename=patterns* β when she's parsing directories, only check filenames matching these comma separated patterns (default:*.py). like a guest list. ποΈ - *
--select=errors* β hand-pick which errors and warnings you want, e.g.E,W6. choose your own adventure. - *
--ignore=errors* β skip errors and warnings, e.g.E4,W. the default ignore list is a whole novel:E121,E123,E126,E226,E24,E704,W503. mind the gap bestie. --firstβ shows the first occurrence of each error. one and done. β-r,--repeatβ (obsolete) shows all occurrences of the same error. she's old, she's tired, but she still shows up.--show-sourceβ shows the actual source code for each error. receipts. π§Ύ--show-pep8β shows the text of PEP 8 for each error. and heads up, this one implies--first. she comes with a plus-one.--statisticsβ counts errors and warnings. numbers. data. slay.--countβ prints the total number of errors and warnings to standard error, and sets the exit code to1if the total is not null. so if there's anything at all, she's giving exit code1. not zero.1. π₯- *
--max-line-length=n* β sets the maximum allowed line length (default:79). seventy-nine. that's the law. π --hang-closingβ hangs the closing bracket instead of matching the indentation of the opening bracket's line. she hangs. she doesn't match. different energy.- *
--format=format* β sets the error format. your choices are[default|pylint|<custom>]. pick your aesthetic. π --diffβ report only lines changed according to the unified diff received onSTDIN. feed her a diff, she minds her business about the rest.--benchmarkβ measures processing speed. how fast is she? apparently we're finding out. πββοΈ- *
--config=path* β the user config file location (default:$HOME/.config/pycodestyle). yes, that exact path. she lives there. π
πΈ USAGE EXAMPLES πΈ
real scenarios, real results. let's go.
Display how often each error was found:
% pycodestyle --statistics -qq example/lib/
look at her. -qq for the silence, --statistics for the numbers. balance. π§
Show source code and more verbose explanation from PEP 8:
% pycodestyle --show-source --show-pep8 foo.py
receipts AND the lore. that's the whole package. β¨
π AUTHOR π
this manual page was written by David Watson <dwatson@debian.org>, Michael Prokop <mika@debian.org> and OndΕej NovΓ½ <onovy@debian.org>.
legends, honestly. respect the authors, they wrote the whole thing. π«Ά
and that's the page bestie!! this one's from pycodestyle 2.0.0, November 2016 β yeah she's a little vintage but she still ate and left no crumbs π β¨ bye!!
π¦ where this page comes from
- debian bookworm: pycodestyle 2.10.0-1 Β· MIT
- debian trixie: pycodestyle 2.12.1-2 Β· MIT
- ubuntu jammy: pycodestyle 2.8.0-2 Β· MIT
- ubuntu noble: pycodestyle 2.11.1-1 Β· MIT
- ubuntu questing: pycodestyle 2.12.1-2
- ubuntu resolute: pycodestyle 2.14.0-1 Β· MIT
- ubuntu stonking: pycodestyle 2.14.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms