diff --git a/.editorconfig b/.editorconfig index 4a2721c..245f5b7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,18 +1,21 @@ +; https://editorconfig.org/ + root = true [*] -charset = utf-8 +indent_style = space +indent_size = 2 end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true insert_final_newline = true -[*.{json,yml,yaml}] -indent_style = space -indent_size = 2 +[*.md] +indent_size = 4 +trim_trailing_whitespace = false -[*.{js,mjs,ts,tsx}] -indent_style = space -indent_size = 2 +[*.sh] +indent_size = 4 -[*.md] -indent_style = space +[*.py] indent_size = 4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..bb6e049 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,43 @@ +--- +# Lint caller that repo-steward adds to public repos without one (rule +# baseline/required-file#lint, policy/baseline.toml [[files]]). It follows +# DevSecNinja/.github workflow-templates/lint.yml and +# docs/workflow-trigger-conventions.md. Private repos get lint-private.yml. +# Renovate keeps the pin and the mise version current. When steward opens the +# PR, main becomes the repo's default branch. +name: Lint + +on: + # gitleaks scans only the PR's own commits here. The full history is + # scanned by secret-scan.yml (DevSecNinja/.github#520); this workflow's + # push run scans it too, as the reusable workflow does on every non-PR event. + pull_request: + # Public repos upload SARIF to code scanning, which needs a default-branch + # analysis as the baseline for PR alerts. + push: + branches: + - main + +permissions: + contents: read + +# One run per PR (or branch). A newer push to a PR cancels its running run; a +# running push run is never cancelled, a queued one is superseded. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + lint: + uses: DevSecNinja/.github/.github/workflows/lint.yml@c93b7670605e165cc757724b690deb130784e803 # v4.4.0 + permissions: + contents: read + security-events: write + with: + # renovate: datasource=github-releases depName=jdx/mise + mise-version: "2026.11.9" + # The linters run from the repo's own mise config (.mise.toml): pin the + # tools it needs there. Every linter is on by default; turning off + # gitleaks, trivy, zizmor or checkov needs a repo-steward exception + # (rule security/ci-scanners). See DevSecNinja/.github + # workflow-templates/lint.yml for the other inputs. diff --git a/.github/workflows/secret-scan.yml b/.github/workflows/secret-scan.yml new file mode 100644 index 0000000..33572e3 --- /dev/null +++ b/.github/workflows/secret-scan.yml @@ -0,0 +1,48 @@ +--- +# Secret-scan caller that repo-steward adds to every repo without one (rule +# baseline/required-file#secret-scan, policy/baseline.toml [[files]]). It +# follows DevSecNinja/.github's own secret-scan-caller.yml: lint-include.yml, +# the thin variant of the reusable lint workflow where every linter is off +# unless set to true, with only gitleaks on. gitleaks scans the full git +# history on every event that isn't a pull request (DevSecNinja/.github#520), +# so new gitleaks +# rules re-check old commits. Findings stay private: public repos upload them +# to code scanning (category gitleaks/history) and log a count only; private +# repos list them in the job summary, which only collaborators can read. +# Pull requests are scanned by the lint caller (their own commits only). +# Renovate keeps the pin and the mise version current. When steward opens the +# PR, main becomes the repo's default branch. +name: Secret scan + +on: + push: + branches: + - main + schedule: + - cron: "23 5 * * 1" + workflow_dispatch: + +permissions: + contents: read + +# A scan that already started finishes; the next one queues. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + gitleaks: + uses: DevSecNinja/.github/.github/workflows/lint-include.yml@c93b7670605e165cc757724b690deb130784e803 # v4.4.0 + permissions: + contents: read + # Public repos: the history findings go to code scanning. + security-events: write + with: + # renovate: datasource=github-releases depName=jdx/mise + mise-version: "2026.11.9" + # History findings only report (warnings); this fails the run when the + # scan or the code scanning upload fails, so a silent gap can't look + # green. gitleaks must be pinned in the repo's .mise.toml. + lint-fail-on-error: true + # lint-include.yml runs no linter unless it is set to true. + lint-gitleaks: true diff --git a/.yamlfmt b/.yamlfmt deleted file mode 100644 index d992ee4..0000000 --- a/.yamlfmt +++ /dev/null @@ -1,8 +0,0 @@ ---- -line_ending: lf -formatter: - type: basic - include_document_start: true - retain_line_breaks_single: true - trim_trailing_whitespace: true - eof_newline: true diff --git a/.yamlfmt.yaml b/.yamlfmt.yaml new file mode 100644 index 0000000..ce24c16 --- /dev/null +++ b/.yamlfmt.yaml @@ -0,0 +1,26 @@ +--- +doublestar: true +formatter: + type: basic + disable_alias_key_correction: true + indent: 2 + max_line_length: 120 + pad_line_comments: 1 + drop_merge_tag: true + eof_newline: true + force_array_style: block + include_document_start: true + line_ending: lf + retain_line_breaks_single: true + scan_folded_as_literal: true + trim_trailing_whitespace: true +# APM-managed / generated files use the tool's own formatting — never hand-edited. +exclude: + - apm.yml + - apm.lock.yaml + - apm_modules/** + # Spec Kit output and Python virtual environments. Listed explicitly rather + # than through gitignore_excludes: without a .gitignore, yamlfmt then lints + # nothing and still exits 0. + - .specify/** + - .venv*/** diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 0000000..6e6f5ff --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,22 @@ +--- +extends: default + +rules: + # Inline comment spacing varies by author style — not auto-fixable + comments: disable + # Long lines are unavoidable with image digests, Traefik labels, and URLs — not auto-fixable + line-length: disable + # Let yamlfmt handle document start markers + document-start: disable + # Allow 'on:' as a mapping key in GitHub Actions workflows + truthy: + allowed-values: + - "true" + - "false" + check-keys: false + +# APM-managed / generated files use the tool's own formatting — never hand-edited. +ignore: |- + apm.yml + apm.lock.yaml + apm_modules/ diff --git a/dprint.json b/dprint.json index 675505a..f5e8c80 100644 --- a/dprint.json +++ b/dprint.json @@ -1,32 +1,26 @@ { - "json": { - "indentWidth": 2 - }, - "markdown": { - "lineWidth": 100, - "textWrap": "always" - }, - "typescript": { - "lineWidth": 100, - "quoteStyle": "alwaysSingle", - "semiColons": "always" - }, - "includes": [ - "**/*.{css,html,json,jsonc,md,ts,tsx}" - ], + "$schema": "https://dprint.dev/schemas/v0.json", + "includes": ["**/*.md"], "excludes": [ - "node_modules", - "dist", - "coverage", - ".vscode", - "src/data/generated", - "public/data/generated" + "**/node_modules", + "**/CHANGELOG.md", + "**/release-notes.md", + "apm_modules/**", + ".github/prompts/**", + ".github/instructions/**", + ".github/agents/**", + ".github/chatmodes/**", + ".claude/**", + ".cursor/**", + ".opencode/**", + ".gemini/**", + ".windsurf/**", + ".kiro/**", + ".agents/**", + ".github/skills/**", + ".specify/**" ], "plugins": [ - "https://plugins.dprint.dev/json-0.23.0.wasm", - "https://plugins.dprint.dev/markdown-0.23.3.wasm", - "https://plugins.dprint.dev/typescript-0.96.1.wasm", - "https://plugins.dprint.dev/g-plane/malva-v0.16.0.wasm", - "https://plugins.dprint.dev/g-plane/markup_fmt-v0.27.3.wasm" + "https://plugins.dprint.dev/markdown-0.21.1.wasm" ] }