Cross-language coding standard (K22-CODE-01..26) adopted from Kingsrook's QQQ CODE_STYLE.md, with profiles for C#/.NET, Java, TypeScript, Python, Rust, Go, Swift, Shell/PowerShell, and Terraform, and the files each IDE and tool imports: IntelliJ scheme, copyright profile and live templates, Checkstyle, Eclipse formatter, .editorconfig, Directory.Build.props, ESLint Stylistic, ruff, rustfmt/clippy/cargo-deny, golangci-lint, swift-format/SwiftLint, ShellCheck, PSScriptAnalyzer, TFLint, sqlfluff, VS Code. Kingsrook files keep their Apache-2.0 notice (NOTICE). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: James Maes <james@kof22.com>
51 lines
1.6 KiB
TOML
51 lines
1.6 KiB
TOML
# KofTwentyTwo Python lint + format configuration (K22-CODE-PY). Copy to the repo root
|
|
# (or merge into [tool.ruff] in pyproject.toml). `ruff format --check` and `ruff check`
|
|
# run in CI and pre-commit with zero findings allowed.
|
|
target-version = "py313"
|
|
# Kingsrook: no practical line-length limit (ruff's maximum is 320).
|
|
line-length = 320
|
|
# Kingsrook: 3-space indentation. Ruff's formatter supports it fully; pycodestyle's
|
|
# "multiple of four" rules (E111/E114) are therefore not selected.
|
|
indent-width = 3
|
|
|
|
[format]
|
|
quote-style = "double"
|
|
indent-style = "space"
|
|
line-ending = "lf"
|
|
docstring-code-format = true
|
|
|
|
[lint]
|
|
select = [
|
|
"F", # pyflakes
|
|
"E4", "E7", "E9", "W", # pycodestyle errors that are layout-independent
|
|
"I", # isort: no wildcard imports, ordered
|
|
"N", # pep8-naming
|
|
"UP", # pyupgrade
|
|
"B", # bugbear
|
|
"S", # bandit security
|
|
"BLE", # blind except
|
|
"T20", # print statements: use logging (Kingsrook logging rule)
|
|
"ERA", # commented-out code (Kingsrook: no zombie code)
|
|
"FIX", # FIXME/TODO must be resolved or tracked
|
|
"TD", # TODO format: author and issue link
|
|
"PTH", # pathlib over os.path
|
|
"RET", "SIM", "C4", "PIE", "PL", "RUF",
|
|
"ANN", # type annotations on every function
|
|
"D", # docstrings on modules, classes, functions
|
|
"LOG", "G", # logging hygiene
|
|
]
|
|
ignore = [
|
|
"D203", # conflicts with D211
|
|
"D213", # conflicts with D212
|
|
"TD003", # issue link is enforced by review, not regex
|
|
]
|
|
|
|
[lint.per-file-ignores]
|
|
"tests/**" = ["S101", "D", "ANN", "PLR2004"]
|
|
|
|
[lint.pydocstyle]
|
|
convention = "pep257"
|
|
|
|
[lint.flake8-tidy-imports]
|
|
ban-relative-imports = "all"
|