feat: adopt treefmt formatting and checks #116

Merged
nimmo merged 1 commit from feat/treefmt-nix into main 2026-07-28 09:14:55 +01:00
Owner

Closes #112

Summary

  • add pinned treefmt-nix integration as the canonical nix fmt formatter
  • format Nix and shell files with nixfmt and shfmt
  • add formatting as a nix flake check derivation
  • document local formatting and CI check commands
  • classify treefmt-nix in the auto-update input policy

Validation

  • nix fmt -- --ci
  • nix flake check
  • shellcheck -S warning scripts/*.sh tests/*.sh
  • actionlint with the repository's documented ignores
  • ./tests/auto-update-regressions.sh
Closes #112 ## Summary - add pinned treefmt-nix integration as the canonical `nix fmt` formatter - format Nix and shell files with nixfmt and shfmt - add formatting as a `nix flake check` derivation - document local formatting and CI check commands - classify treefmt-nix in the auto-update input policy ## Validation - `nix fmt -- --ci` - `nix flake check` - `shellcheck -S warning scripts/*.sh tests/*.sh` - `actionlint` with the repository's documented ignores - `./tests/auto-update-regressions.sh`
feat: adopt treefmt formatting and checks
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m2s
Build and Push Attic Cache / build (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 5m18s
2671a70e25
Author
Owner

Automated code review

Reviewed commit: 2671a70e25cf78d7cf667e7ae2b457b84d9970aa

Verdict: Ready to merge

No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.

Overall assessment

Adopts treefmt-nix to replace a custom shell-based formatter, updates flake inputs and auto-update policy accordingly, documents formatting commands in README, and adjusts regression tests to reflect the new policy group count. Formatting changes across scripts and modules are consistent with shfmt/nixfmt conventions.

Blocking findings

None.

Important findings

None.

Suggestions

  • Document 2-space shell indentation standard (treefmt.nix:9; high confidence)
    options = [ "-i" "2" ];
    Impact: Enforces 2-space indentation for shell scripts, which may differ from common conventions and could cause friction during manual edits or reviews.
    Suggested fix: Add a brief note in README.md under the formatting section to guide contributors.

  • Consider dynamic system evaluation for formatter (flake.nix:93; medium confidence)
    treefmtEval = treefmt-nix.lib.evalModule nixpkgs.legacyPackages.x86_64-linux ./treefmt.nix;
    Impact: Hardcodes the package set to x86_64-linux. If the flake is evaluated on a different architecture, formatter evaluation may fail unless explicitly handled elsewhere.
    Suggested fix: Consider passing the system's packages dynamically or document that formatters are intentionally restricted to the host platform.

Tests and validation

  • No configured deterministic checks.

Questions

  • Is there an intention to support formatter evaluation on non-x86_64-linux architectures in the future, or is it intentionally host-platform restricted?

Review limitations

  • Review is based solely on provided diff and documentation. Actual formatting behavior and CI gate results depend on the local Nix environment and treefmt-nix version resolution.
  • Line numbers are approximate due to diff context shifts.

Diff coverage

  • README.md: reviewed — included in a context-limited batch
  • flake.lock: reviewed — included in a context-limited batch
  • flake.nix: reviewed — included in a context-limited batch
  • lib/auto-update-policy.nix: reviewed — included in a context-limited batch
  • modules/common/pangolin-mcp-launcher.nix: reviewed — included in a context-limited batch
  • modules/networking/nebula.nix: reviewed — included in a context-limited batch
  • modules/profiles/ollama.nix: reviewed — included in a context-limited batch
  • modules/services/whisper.nix: reviewed — included in a context-limited batch
  • scripts/attic-cache-build.sh: reviewed — included in a context-limited batch
  • scripts/auto-update-recover-stopped.sh: reviewed — included in a context-limited batch
  • scripts/auto-update-workflow-route.sh: reviewed — included in a context-limited batch
  • scripts/nixos-auto-update-control.sh: reviewed — included in a context-limited batch
  • scripts/nixos-auto-update.sh: reviewed — included in a context-limited batch
  • scripts/nixos-update-common.sh: reviewed — included in a context-limited batch
  • scripts/personalise.sh: reviewed — included in a context-limited batch
  • tests/auto-update-regressions.sh: reviewed — included in a context-limited batch
  • treefmt.nix: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: qwen3.6:35b-a3b-q8_0
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, README.md
  • Commits considered: 1
  • Previous automated review: none found
  • Findings: 2
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `2671a70e25cf78d7cf667e7ae2b457b84d9970aa` ## Verdict: Ready to merge No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory. ### Overall assessment Adopts treefmt-nix to replace a custom shell-based formatter, updates flake inputs and auto-update policy accordingly, documents formatting commands in README, and adjusts regression tests to reflect the new policy group count. Formatting changes across scripts and modules are consistent with shfmt/nixfmt conventions. ### Blocking findings None. ### Important findings None. ### Suggestions - **Document 2-space shell indentation standard** (treefmt.nix:9; high confidence) options = [ "-i" "2" ]; Impact: Enforces 2-space indentation for shell scripts, which may differ from common conventions and could cause friction during manual edits or reviews. Suggested fix: Add a brief note in README.md under the formatting section to guide contributors. - **Consider dynamic system evaluation for formatter** (flake.nix:93; medium confidence) treefmtEval = treefmt-nix.lib.evalModule nixpkgs.legacyPackages.x86_64-linux ./treefmt.nix; Impact: Hardcodes the package set to x86_64-linux. If the flake is evaluated on a different architecture, formatter evaluation may fail unless explicitly handled elsewhere. Suggested fix: Consider passing the system's packages dynamically or document that formatters are intentionally restricted to the host platform. ### Tests and validation - No configured deterministic checks. ### Questions - Is there an intention to support formatter evaluation on non-x86_64-linux architectures in the future, or is it intentionally host-platform restricted? ### Review limitations - Review is based solely on provided diff and documentation. Actual formatting behavior and CI gate results depend on the local Nix environment and treefmt-nix version resolution. - Line numbers are approximate due to diff context shifts. ### Diff coverage - `README.md`: **reviewed** — included in a context-limited batch - `flake.lock`: **reviewed** — included in a context-limited batch - `flake.nix`: **reviewed** — included in a context-limited batch - `lib/auto-update-policy.nix`: **reviewed** — included in a context-limited batch - `modules/common/pangolin-mcp-launcher.nix`: **reviewed** — included in a context-limited batch - `modules/networking/nebula.nix`: **reviewed** — included in a context-limited batch - `modules/profiles/ollama.nix`: **reviewed** — included in a context-limited batch - `modules/services/whisper.nix`: **reviewed** — included in a context-limited batch - `scripts/attic-cache-build.sh`: **reviewed** — included in a context-limited batch - `scripts/auto-update-recover-stopped.sh`: **reviewed** — included in a context-limited batch - `scripts/auto-update-workflow-route.sh`: **reviewed** — included in a context-limited batch - `scripts/nixos-auto-update-control.sh`: **reviewed** — included in a context-limited batch - `scripts/nixos-auto-update.sh`: **reviewed** — included in a context-limited batch - `scripts/nixos-update-common.sh`: **reviewed** — included in a context-limited batch - `scripts/personalise.sh`: **reviewed** — included in a context-limited batch - `tests/auto-update-regressions.sh`: **reviewed** — included in a context-limited batch - `treefmt.nix`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: qwen3.6:35b-a3b-q8_0 - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, README.md - Commits considered: 1 - Previous automated review: none found - Findings: 2 </details>
nimmo merged commit f7923d04d1 into main 2026-07-28 09:14:55 +01:00
nimmo deleted branch feat/treefmt-nix 2026-07-28 09:15:17 +01:00
Sign in to join this conversation.
No reviewers
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/nixos-config!116
No description provided.