mirror of
https://github.com/cole-maxwell1/dotfiles.git
synced 2026-10-27 16:32:49 -05:00
- add conventions for Bash, C#, Go, Python, and TypeScript - add frontend guidance for HTMX, PrimeVue, and Vue - document formatting, typing, testing, async, and framework-specific practices - reference official documentation for framework API details
971 B
971 B
name, description
| name | description |
|---|---|
| python | Python conventions (PEP 8, ruff, type hints). Use when editing .py files. |
Python Conventions
Style
- Follow PEP 8; run
ruff checkandruff formatfor linting and formatting. - Let ruff manage line length and import ordering; do not hand-format against it.
Typing
- Add type hints on all function signatures; prefer modern syntax (
list[int],X | None) on supported Python versions. - Use
dataclasses(or Pydantic where validation is required) for structured data. - Prefer an explicit exception hierarchy over bare
except:.
Idioms
- Prefer
pathlib.Pathoveros.path. - Use f-strings for interpolation; use the
loggingmodule with structured handlers instead ofprintin libraries. - Prefer comprehensions and generator expressions over manual loops where readability is preserved.
Testing
- Use
unittest(orpytestif the project adopts it); mirror the source layout under atests/directory.