From f26d3014f5f2a02db22fb66ef808842698ce02c5 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 5 Oct 2026 14:27:29 +0000 Subject: [PATCH 1/2] build: lint TOML with Tombi Taplo is unmaintained, so format and lint TOML with Tombi in just, lefthook, and CI. Co-authored-by: Michael Bianco --- .config/mise.dev.lock | 50 +++++++++++++++++++++++++ .config/mise.dev.toml | 3 +- .github/workflows/build_and_publish.yml | 1 + .vscode/extensions.json | 4 +- .vscode/settings.json | 1 + Justfile | 4 +- just/dev.just | 18 +++++++++ lefthook.yml | 2 + pyproject.toml | 2 +- tombi.toml | 27 +++++++++++++ 10 files changed, 107 insertions(+), 5 deletions(-) create mode 100644 tombi.toml diff --git a/.config/mise.dev.lock b/.config/mise.dev.lock index eb24b2c3..78a1117d 100644 --- a/.config/mise.dev.lock +++ b/.config/mise.dev.lock @@ -294,6 +294,9 @@ version = "1.58.0" backend = "ubi:casey/just" specifiers = ["latest"] +[tools.just."platforms.linux-x64-just"] +checksum = "blake3:e36b85d760b5980ec163a0246e5430c2de6e32ee282125be903d7dec49c610ed" + [[tools.mprocs]] version = "0.9.6" backend = "aqua:pvolok/mprocs" @@ -334,6 +337,53 @@ checksum = "sha256:9dc6e49ef47c7aa2e6a2844503d6cfa34e51a4d15dd78abef6e6de2fc10e5 url = "https://github.com/pvolok/dekit/releases/download/v0.9.6/mprocs-0.9.6-windows-x86_64.zip" url_api = "https://api.github.com/repos/pvolok/dekit/releases/assets/440298377" +[[tools.tombi]] +version = "1.5.5" +backend = "aqua:tombi-toml/tombi" +specifiers = ["latest"] + +[tools.tombi."platforms.linux-arm64"] +checksum = "sha256:a545a471cec6baf982bcb8e274d097303cece1a72136ada79d240adb6d1354f6" +url = "https://github.com/tombi-toml/tombi/releases/download/v1.5.5/tombi-cli-1.5.5-aarch64-unknown-linux-musl.tar.gz" +url_api = "https://api.github.com/repos/tombi-toml/tombi/releases/assets/559313379" +provenance = "github-attestations" + +[tools.tombi."platforms.linux-arm64-musl"] +checksum = "sha256:a545a471cec6baf982bcb8e274d097303cece1a72136ada79d240adb6d1354f6" +url = "https://github.com/tombi-toml/tombi/releases/download/v1.5.5/tombi-cli-1.5.5-aarch64-unknown-linux-musl.tar.gz" +url_api = "https://api.github.com/repos/tombi-toml/tombi/releases/assets/559313379" +provenance = "github-attestations" + +[tools.tombi."platforms.linux-x64"] +checksum = "sha256:6c50d2589989e8182e9f6e774b4b25c9f5729b67a2a7e7dcaadddbedbe1da5ec" +url = "https://github.com/tombi-toml/tombi/releases/download/v1.5.5/tombi-cli-1.5.5-x86_64-unknown-linux-musl.tar.gz" +url_api = "https://api.github.com/repos/tombi-toml/tombi/releases/assets/559313407" +provenance = "github-attestations" + +[tools.tombi."platforms.linux-x64-musl"] +checksum = "sha256:6c50d2589989e8182e9f6e774b4b25c9f5729b67a2a7e7dcaadddbedbe1da5ec" +url = "https://github.com/tombi-toml/tombi/releases/download/v1.5.5/tombi-cli-1.5.5-x86_64-unknown-linux-musl.tar.gz" +url_api = "https://api.github.com/repos/tombi-toml/tombi/releases/assets/559313407" +provenance = "github-attestations" + +[tools.tombi."platforms.macos-arm64"] +checksum = "sha256:460b3269414d2ca26e05863908764f118bea3b4a52068081af6a3dae03c1320e" +url = "https://github.com/tombi-toml/tombi/releases/download/v1.5.5/tombi-cli-1.5.5-aarch64-apple-darwin.tar.gz" +url_api = "https://api.github.com/repos/tombi-toml/tombi/releases/assets/559313381" +provenance = "github-attestations" + +[tools.tombi."platforms.macos-x64"] +checksum = "sha256:9276c456e4a0217e95fb84ac3cde29d281d7b53e5eb168d83cb038ec07e2083d" +url = "https://github.com/tombi-toml/tombi/releases/download/v1.5.5/tombi-cli-1.5.5-x86_64-apple-darwin.tar.gz" +url_api = "https://api.github.com/repos/tombi-toml/tombi/releases/assets/559313375" +provenance = "github-attestations" + +[tools.tombi."platforms.windows-x64"] +checksum = "sha256:49e8aa14e82038a13c5f9f50cc6524b56b9bce167734bead31439939e0830a3b" +url = "https://github.com/tombi-toml/tombi/releases/download/v1.5.5/tombi-cli-1.5.5-x86_64-pc-windows-msvc.zip" +url_api = "https://api.github.com/repos/tombi-toml/tombi/releases/assets/559313401" +provenance = "github-attestations" + [[tools.watchexec]] version = "2.7.3" backend = "aqua:watchexec/watchexec" diff --git a/.config/mise.dev.toml b/.config/mise.dev.toml index d514e770..96721f77 100644 --- a/.config/mise.dev.toml +++ b/.config/mise.dev.toml @@ -7,7 +7,6 @@ min_version = "2026.10.0" # only for local development/CI. [tools] - ######## # Core # ######## @@ -28,3 +27,5 @@ direnv = "latest" "github:chmln/sd" = "latest" "ast-grep" = "latest" "github:dmtrKovalenko/odiff" = "latest" +# TOML formatter and linter. Taplo is unmaintained; Tombi is the maintained replacement. +tombi = "latest" diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml index 909d55da..9fcf229d 100644 --- a/.github/workflows/build_and_publish.yml +++ b/.github/workflows/build_and_publish.yml @@ -75,6 +75,7 @@ jobs: ${{ runner.os }}-playwright- - run: just py_setup - run: just py_lint + - run: just toml_lint - run: just db_migrate - run: just db_lint - run: just py_test diff --git a/.vscode/extensions.json b/.vscode/extensions.json index ce732abb..5b5600a3 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -22,7 +22,7 @@ "GitHub.vscode-pull-request-github", "Gruntfuggly.todo-tree", "ms-azuretools.vscode-docker", - "tamasfe.even-better-toml", + "tombi-toml.tombi", "nefrob.vscode-just-syntax", "streetsidesoftware.code-spell-checker", "davidanson.vscode-markdownlint", @@ -36,6 +36,8 @@ // this occurs even if you disable the extension. "hverlin.mise-vscode", "firsttris.vscode-jest-runner", + // Tombi replaces Even Better TOML + "tamasfe.even-better-toml", // ruff replaces all of these py linting tools "ms-python.isort", "ms-python.flake8", diff --git a/.vscode/settings.json b/.vscode/settings.json index a164ca54..8fd20223 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -46,6 +46,7 @@ "[toml]": { "editor.formatOnSave": true, + "editor.defaultFormatter": "tombi-toml.tombi", "editor.tabSize": 4 }, "python.analysis.autoFormatStrings": true, diff --git a/Justfile b/Justfile index e53c02b5..93da8afe 100644 --- a/Justfile +++ b/Justfile @@ -60,11 +60,11 @@ generate: dev_generate py_generate js_generate # run automatic fix operations for all linters [parallel] -fix: js_lint-fix py_lint_fix +fix: js_lint-fix py_lint_fix toml_lint_fix # run all linters [parallel] -lint: js_lint py_lint db_lint dev_lint +lint: js_lint py_lint db_lint dev_lint toml_lint # nicely clean all build artifacts and caches clean: js_clean py_clean build_clean diff --git a/just/dev.just b/just/dev.just index 6448b179..8cf1d0f6 100644 --- a/just/dev.just +++ b/just/dev.just @@ -19,6 +19,24 @@ dev_lint: # TODO link justfiles too # GIT_CONFIG_GLOBAL=/dev/null gitleaks git --report-format json --report-path - | jq -r '.[].Fingerprint' | sort -t ':' -k2 > .gitleaksignore +# format and lint TOML. Both run so a format failure does not hide a lint failure. +[script] +toml_lint: + set +e + exit_code=0 + + tombi format --check . || exit_code=$? + tombi lint . || exit_code=$? + + if [[ -n "${exit_code:-}" && "${exit_code}" != 0 ]]; then + echo "One or more commands failed" + exit 1 + fi + +# format TOML. Lint findings are reported by `toml_lint`; Tombi has no lint autofix. +toml_lint_fix: + tombi format . + # start all of the services you need for development in a single terminal [script] [arg("open", long, help="open the development site in the browser", flag)] diff --git a/lefthook.yml b/lefthook.yml index 4a9626b7..b67cc8bf 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -45,6 +45,8 @@ pre-push: run: just py_lint js_lint: run: just js_lint + toml_lint: + run: just toml_lint # post-merge: fires after git merge / git pull # post-rewrite: fires after git rebase / git commit --amend diff --git a/pyproject.toml b/pyproject.toml index 61d3070e..9b629f75 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -157,7 +157,7 @@ exclude = [ ] # https://github.com/microsoft/pylance-release/blob/71dcf9409c5ba65f1138069ac80ae9e2122d7867/USING_WITH_PYRIGHT.md # the above documentation seems out of date: autoSearchPaths and extraPaths is deprecated -extraPaths = [] # Include paths from PYTHONPATH env var and .env definition +extraPaths = [] # Include paths from PYTHONPATH env var and .env definition typeCheckingMode = "standard" [tool.djlint] diff --git a/tombi.toml b/tombi.toml new file mode 100644 index 00000000..c0191fbb --- /dev/null +++ b/tombi.toml @@ -0,0 +1,27 @@ +# Tombi config: https://tombi-toml.github.io/tombi/docs/configuration/ +# Generated lockfiles are rewritten by their own tools, so they stay out of format and lint. + +[files] +exclude = [ + "uv.lock", + ".config/mise.lock", + ".config/mise.dev.lock", + ".config/mise.extras.lock", + ".config/mise/locks/**", +] + +[format.rules] +# Match the existing TOML style and the editor tab size. +indent-width = 4 + +[lint.rules] +# pyproject.toml is kept in hand-written order, so schema table order is noise. +tables-out-of-order = "off" + +# Schema Store marks pyproject.toml for key sorting. Keep the file's existing +# order so `uv add` and hand-edited groups are not rewritten on format. +[[schemas]] +path = "tombi://www.schemastore.org/pyproject.json" +include = ["pyproject.toml"] +format.rules.array-values-order.enabled = false +format.rules.table-keys-order.enabled = false From 93d7b0559e1ccb4744e72cb57d424e3d781754dc Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 5 Oct 2026 18:41:46 +0000 Subject: [PATCH 2/2] build: exclude all lockfiles from Tombi Use a **/*.lock glob so new lockfiles are skipped without listing each path. Co-authored-by: Michael Bianco --- tombi.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tombi.toml b/tombi.toml index c0191fbb..7ee6cb0a 100644 --- a/tombi.toml +++ b/tombi.toml @@ -3,10 +3,8 @@ [files] exclude = [ - "uv.lock", - ".config/mise.lock", - ".config/mise.dev.lock", - ".config/mise.extras.lock", + "**/*.lock", + # vendored tool metadata under mise's lock cache, not project config ".config/mise/locks/**", ]