mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-12-05 02:23:30 +01:00
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1.7 KiB
1.7 KiB
name, description
| name | description |
|---|---|
| embedded-python-standard | Use ONLY when writing, editing, or reviewing Python in a picokit project (gateway/, scripts/, tests/). Enforces full PEP 8 via pycodestyle at 79 columns, a module/class/function docstring with Parameters and Returns sections on everything, no function over 8 executable lines, no blank lines inside a function body, and a ban on em/en dashes. Run the bundled audit_python_standard.py before every commit. |
Embedded Python standard (picokit)
This is non-negotiable and identical in every project in the series. There is no variation between projects.
Rules
- Full PEP 8, enforced by
pycodestyleat--max-line-length=79. Four-space indent, no tabs, no trailing whitespace, two blank lines between top-level definitions. - No function or method longer than 8 executable lines. The docstring does not count toward the limit. Split the work into a helper.
- No blank lines inside a function body.
- Every module, class, function, and method has a docstring. Function and
method docstrings contain a
Parameterssection and aReturnssection (writeNonewhen nothing is returned). - No U+2013 (en dash) or U+2014 (em dash) anywhere. Use the hyphen-minus
-. - Imports are grouped standard library, third party, local, with one import per line.
Layout
gateway/ rylr998.py codec.py crypto.py store.py tui.py web/ cli.py
sim.py
scripts/ run_tests.py check_coverage.py build.sh
tests/
Verify
Run the bundled audit from the repository root. Exit 0 is clean; any output is a failure and must be fixed before the change is complete.
python3 .opencode/skill/embedded-python-standard/audit_python_standard.py