PYCODESTYLE(1)

πŸ“¦
version 2.14.0 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… 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 to 1 if the total is not null. so if there's anything at all, she's giving exit code 1. 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 on STDIN. 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