Skip to main content

code-standards

One deterministic quality gate for Sarj Python, TypeScript, Swift, Kotlin, shell, SQL, IaC, and repository policy.

uv tool install --python 3.15 code-standards

Adopt the repository once with code-standards setup. It installs one canonical staged gate that includes semantic lint and repository policy, plus commit-message and pull-request history enforcement. Do not install Repo Standards separately.

code-standards setup
code-standards check
code-standards check --rule python:no-excessive-cognitive-complexity src/
code-standards fix
code-standards doctor
code-standards update

Use repeatable check --rule ENGINE:ID selectors to select native rules, ESLint rules, or managed security audits. Exclusions, baselines, and severities still apply; Ruff selectors are not supported. Native linters and ESLint execute only selected rules. ESLint retains configured parsers, options, severities, and suppression directives.

Terraform, Kubernetes, and GitHub Actions adoption adds isolated Checkov 3.3.20 and zizmor 1.30.1 runtimes. Setup and generated CI prewarm these tools; checks run offline with packaged policy. Use --rule checkov:CKV_GCP_95 or --rule zizmor:template-injection to select upstream audits. Their findings start as warnings, use the canonical diagnostic baseline, and retain upstream IDs. Checkov honors its inline suppression directives; zizmor ignore comments are disabled. Explicit zizmor selectors include auditor-persona checks; online-only audits cannot run offline. Parsing or execution failures leave the analysis incomplete. Image digest evidence for source templates is deferred to their rendered deployment artifacts.

The opt-in jscpd capability runs the jscpd 5.4.0 copy-paste detector, which setup installs through mise. Setup and upgrades list it in [capabilities].disable; remove it there to enable it. Each check scans Python, TypeScript, Swift and Kotlin source outside test directories, because a copy can only be found by comparing it with the whole tree. Every repeated block of at least 50 tokens is a jscpd:duplicate-code warning on its own lines that names the other copies, so the changed-line baseline reports it when either side is edited. The repository's own jscpd configuration is ignored.

The shfmt capability checks shell files, including extensionless shebang entrypoints, with shfmt 3.14.1 using two-space indentation and indented case clauses. Explicit, staged and PR-selected files must be formatted in full; full scans report existing drift as warnings. Formatting errors on selected files cannot be hidden by a diagnostic baseline. code-standards fix formats selected files safely, preserving executable permissions; generated Gradle launchers are excluded. Shebangs determine the shell before filename suffixes. Zsh formatting does not provide ShellCheck coverage: its unsupported dialect remains an explicit coverage failure. Ambient editor settings cannot change the canonical style, and simplification is disabled.

ShellCheck and shfmt also inspect executable shell fields in workflows, composite actions, Cloud Build, Make and Mise using the same policy as shell files. Analysis follows the configured interpreter, including inherited Actions shells and Cloud Build shebangs, and reports positions in the authored configuration. Actions expressions are masked for native parsing, and actionlint retains workflow validation while shared ShellCheck supplies shell findings once. Docker shell semantics remain owned by Hadolint. Fixes can format verified literal YAML blocks while preserving scalar headers, newlines and decoded execution source. Folded scalars, aliases, templates, argv, Make and Mise remain check-only; extract complex programs to shell files for independently linted execution.

The shared ShellCheck policy enables check-set-e-suppressed alongside the existing check-extra-masked-returns. SC2310 and SC2311 warn when function calls suppress set -e, including conditional calls and command substitutions. Review intentional predicates and use justified native ShellCheck suppressions where appropriate; these findings have no automatic semantic fix. SC2312 remains enabled to detect masked exit status. The repository shell gate prints the new warnings without failing for them and retains its existing blocking checks.

The opt-in knip capability uses Knip 6.41.0 production mode. Remove it from [capabilities].disable and declare application = true under [knip] to enable advisory knip:files evidence. Version one supports a single private application with entry and project arrays containing production patterns ending in ! in knip.json or .knip.json. Native aliases and framework entries remain authoritative; unresolved imports, configuration diagnostics, workspaces and dynamic configuration make the graph inconclusive. Review runtime and public owners before deleting a module. No automatic fixes or application inference are performed.

Unused private Python test helpers require reportUnusedFunction set to warning in the consumer's existing BasedPyright test execution environments. This bundle preserves native configuration and bounds test warnings to authored, undecorated module-level private helpers in conventional test paths. Decorated fixtures, methods and production callbacks are excluded; no consumer diagnostic setting is enabled automatically. Existing production diagnostics are preserved.

check --jobs 2 overlaps native analysis with the external-tool pipeline. The default is --jobs 1; external tools remain sequential and report ordering is deterministic.

DevOps execution blocks may sequence existing commands without helper scripts. Keep interpreter source, control flow, logical chains, pipelines and substitutions in independently linted files; Python -m and script paths, and jq/awk -f files remain supported. SARJ310 is an error, including short inline programs. Cloud Build SARJ315 checks unique IDs, ordered step dependencies, script/argv exclusivity and rejects untrusted substitutions in shell source; pass substitutions as quoted arguments to external scripts.

The source gate uses pinned actionlint, shared ShellCheck, offline Zizmor, Hadolint and Skaffold v4beta7 schema validation. Cloud Deploy validation is a documented partial structural contract. Terraform validation and TFLint require explicit repository trust and prepared local providers; analysis never initializes or downloads them. Compose requires an exact consumer [devops].compose_version; its source check does not resolve environment inputs.

Release gates use code-standards analyze --prepared-only --prepared-devops prepared.json --prepared-target TARGET_ID. Declare exact prepared_targets under [devops] with an authored source path. Version-one receipts bind target IDs, authored input hashes, staged chart archives, ordered values, typed set arguments, manifests and a hashed local schema closure. Helm 3.19.0 strict lint and stage-specific rendering feed kubeconform 0.8.0 and kube-linter 0.8.3. Missing tools, schemas, targets and invalid receipts fail the gate. Prepared-only findings bypass source debt baselines; container exceptions require exact target, GVK, namespace, object, check, container kind, container name and a reason, and stale exceptions fail.

Source-only checks report prepared validation as deferred. They do not certify generated manifests or replace Cloud Deploy, Cloud Build or Kubernetes admission validation. Run setup --tools-only in CI after installing the bundle and the pinned mise bootstrap. It requires an existing manifest, installs and attests the applicable native tools, and preserves repository wiring. Release analysis consumes prepared bytes without pulling charts.

Documentation · Source

Metadata

Release files for code-standards 8.47.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for code-standards 8.47.2
File Size Uploaded
code_standards-8.47.2.tar.gz 834.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for code-standards 8.47.2
File Interpreter ABI Platform
code_standards-8.47.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.8 MB

Release files / code_standards-8.47.2.tar.gz

Download URL code_standards-8.47.2.tar.gz
Size 834.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ef2affb098e4ef0c9560b5982b1662b5ef6642bddfa85416f3aed59b597c05d0
BLAKE2b-256 checksum
How to use checksums
72ddd8a6670efd8dedd20435f89726487e444d845c86a41dfdae39b4606011dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / code_standards-8.47.2-py3-none-any.whl

Download URL code_standards-8.47.2-py3-none-any.whl
Size 920.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57bafed627f78ff73f15f4818fe18a4e46ff1587315738df1362389a1172f53f
BLAKE2b-256 checksum
How to use checksums
175389822405b67060920d83c1498b0afece0a3a7c889aef185e5466e1966bca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release history Release notifications | RSS feed

8.53.0

2 release files

8.52.0

2 release files

8.51.0

2 release files

8.50.2

2 release files

8.50.1

2 release files

8.50.0

2 release files

8.49.1

2 release files

8.49.0

2 release files

8.48.6

2 release files

8.48.5

2 release files

8.48.4

2 release files

8.48.3

2 release files

8.48.2

2 release files

8.48.1

2 release files

8.48.0

2 release files

8.47.6

2 release files

8.47.5

2 release files

8.47.4

2 release files

8.47.3

2 release files

This release

8.47.2 This release

2 release files

8.47.1

2 release files

8.47.0

2 release files

8.46.0

2 release files

8.45.0

2 release files

8.44.0

2 release files

8.43.2

2 release files

8.43.1

2 release files

8.43.0

2 release files

8.42.2

2 release files

8.42.1

2 release files

8.42.0

2 release files

8.41.3

2 release files

8.41.2

2 release files

8.41.1

2 release files

8.41.0

2 release files

8.13.3

2 release files

8.13.2

2 release files

8.13.1

2 release files

8.12.1

2 release files

8.12.0

2 release files

8.11.7

2 release files

8.11.6

2 release files

8.11.5

2 release files

8.11.4

2 release files

8.11.3

2 release files

8.11.2

2 release files

8.11.1

2 release files

8.11.0

2 release files

8.10.2

2 release files

8.10.1

2 release files

8.10.0

2 release files

8.9.0

2 release files

8.8.2

2 release files

8.8.1

2 release files

8.8.0

2 release files

8.7.0

2 release files

8.6.1

2 release files

8.6.0

2 release files

8.5.0

2 release files

8.4.0

2 release files

8.3.3

2 release files

8.3.1

2 release files

8.3.0

2 release files

8.2.11

2 release files

8.2.10

2 release files

8.2.9

2 release files

8.2.7

2 release files

8.2.4

2 release files

8.2.3

2 release files

8.2.2

2 release files

8.2.1

2 release files

8.2.0

2 release files

8.1.4

2 release files

8.1.3

2 release files

8.1.2

2 release files

8.1.1

2 release files

8.1.0

2 release files

7.33.0

2 release files

7.32.9

2 release files

7.32.8

2 release files

7.32.7

2 release files

7.32.6

2 release files

7.32.5

2 release files

7.32.4

2 release files

7.32.3

2 release files

7.32.2

2 release files

7.32.1

2 release files

7.32.0

2 release files

7.31.9

2 release files

7.31.8

2 release files

7.31.7

2 release files

7.31.6

2 release files

7.31.5

2 release files

7.31.4

2 release files

7.31.3

2 release files

7.31.2

2 release files

7.31.1

2 release files

7.31.0

2 release files

7.29.0

2 release files

7.28.0

2 release files

7.27.8

2 release files

7.27.7

2 release files

7.27.6

2 release files

7.27.5

2 release files

7.27.4

2 release files

7.27.3

2 release files

7.27.2

2 release files

7.27.1

2 release files

7.27.0

2 release files

7.26.3

2 release files

7.26.2

2 release files

7.26.1

2 release files

7.26.0

2 release files

7.25.0

2 release files

7.24.3

2 release files

7.24.2

2 release files

7.24.1

2 release files

7.24.0

2 release files

7.23.1

2 release files

7.23.0

2 release files

7.22.0

2 release files

7.21.0

2 release files

7.20.3

2 release files

7.20.2

2 release files

7.20.1

2 release files

7.19.0

2 release files

7.18.1

2 release files

7.16.2

2 release files

7.16.1

2 release files

7.16.0

2 release files

7.15.9

2 release files

7.15.8

2 release files

7.15.7

2 release files

7.15.4

2 release files

7.15.3

2 release files

7.15.2

2 release files

7.15.1

2 release files

7.15.0

2 release files

7.9.9

2 release files

7.9.8

2 release files

7.9.7

2 release files

7.9.6

2 release files

7.9.5

2 release files

7.9.4

2 release files

7.9.3

2 release files

7.9.2

2 release files

7.9.1

2 release files

7.9.0

2 release files

7.8.0

2 release files

7.7.0

2 release files

7.6.3

2 release files

7.5.4

2 release files

7.5.3

2 release files

7.5.2

2 release files

7.5.1

2 release files

7.5.0

2 release files

7.4.0

2 release files

7.3.3

2 release files

7.3.2

2 release files

7.3.1

2 release files

7.3.0

2 release files

7.2.1

2 release files

7.2.0

2 release files

7.1.18

2 release files

7.1.16

2 release files

7.1.15

2 release files

7.1.14

2 release files

7.1.13

2 release files

7.1.12

2 release files

7.1.11

2 release files

7.1.10

2 release files

7.1.9

2 release files

7.1.8

2 release files

7.1.7

2 release files

7.1.6

2 release files

7.1.5

2 release files

7.1.4

2 release files

7.1.3

2 release files

7.1.2

2 release files

7.1.1

2 release files

7.1.0

2 release files

7.0.5

2 release files

7.0.4

2 release files

7.0.3

2 release files

7.0.2

2 release files

7.0.1

2 release files

7.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page