GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(id): make the seven formatter/lint flake checks actually fail (#702) by dezren39 · Pull Request #711 · developing-today/code Conversation
|
| Check | Files | Violations (authoritative, flake tool versions / sandbox conditions) | Action |
|---|---|---|---|
| rustfmt | 240 .rs |
0 | enforce |
| shfmt | 13 .sh |
0 | enforce |
taplo check |
10 .toml |
0 | enforce |
| prettier | 26 files | 0 — but only with the root .editorconfig visible (see below) |
enforce + mirror config |
| statix | 13 .nix |
0 — but only with the root statix.toml visible (see below) |
enforce + mirror config + structural loop fix |
| shellcheck | 13 .sh |
4 info (SC2012, ls glob picks in examples/*/build.sh), 0 warning+ |
enforce at --severity=warning |
| treefmt | 347 processed | 3 files, all taplo formatting of Cargo.toml files (root + 2 in vendor/) |
enforce + format root Cargo.toml + exclude vendor/** |
pkgs/id is a standalone flake: its checks build from a source copy of pkgs/id alone, so configs at the repo root are invisible in the sandbox while local runs resolve them by walking up:
.editorconfig [*.md] max_line_length=off drives prettier's markdown print width — without it, one .plannotator plan file fails prettier/treefmt in the sandbox only.statix.toml disables repeated_keys — without it, W20 fires on the NixOS test files' idiomatic dotted nodes.<name> paths.Fix: pkgs/id/.editorconfig and pkgs/id/statix.toml mirror the root files, so the flake formats/lints identically in the sandbox and in a working tree. (A local shellcheck census under the root .shellcheckrc's enable=all shows ~166 style findings; that rc does not reach the sandbox and is deliberately not mirrored — the check keeps shellcheck's default lint set, now enforced at warning severity.)
pkgs/id/flake.nix: remove all seven || trues (grep '|| true' pkgs/id/flake.nix → no hits); statix loop now collects failures via process substitution (a piped while runs in a subshell and loses the flag); shellcheck gains --severity=warning with the census recorded in a comment.pkgs/id/Cargo.toml: taplo formatting only (two long inline tables wrapped).pkgs/id/treefmt.toml: exclude vendor/** (vendored upstream crates are not ours to reformat).pkgs/id/.editorconfig, pkgs/id/statix.toml: new mirrors of the root configs (see above).nix build of the six buildable checks on the fixed tree: rustfmt, shfmt, shellcheck, taplo, prettier, statix all PASS (prettier/statix failed before the config mirrors, pass after).treefmt --ci on the fixed tree: PASS, 0 changed (277 files processed). Its nix build is blocked in this sandbox only by the known symlinked-store cc purity failure while building the bun2nix dependency (impure path .../liblto_plugin.so used in link) — that failure does not occur on CI runners with a real store dir; the PR's own CI is the verdict for this one check..rs, .sh, .toml, .md, a warning-level shell bug (SC2164), and a statix-flagged .nix (empty let) each make the corresponding check command fail.nixfmt --check clean on flake.nix; the guard script's check list is unchanged (all seven names stay in id-pr-checks.txt).Single-repo: no other repo's flake has this pattern (per the issue's grep verification).
Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Remove the '|| true' that made treefmt/rustfmt/statix/shfmt/ shellcheck/taplo/prettier checks in pkgs/id/flake.nix always succeed, after a per-tool violation census on main f7dfea3: - rustfmt (240 files), shfmt (13), taplo check (10), prettier (26): zero violations - enforce as-is. - statix: zero violations under the project config, but the sandbox source copy cannot see the repo-root statix.toml that disables repeated_keys, so W20 fired on the NixOS test files' dotted nodes.<name> paths. Add pkgs/id/statix.toml mirroring the root config, and restructure the per-file loop to collect failures (process substitution - a piped while loses the flag). - shellcheck: enforced at --severity=warning. Under sandbox conditions (no .shellcheckrc) shellcheck reports only four info findings (SC2012 in the examples' build.sh files) and no warning-or-above findings. - treefmt: only three files changed, all taplo formatting of Cargo.toml files. Format pkgs/id/Cargo.toml and exclude vendor/** in treefmt.toml (vendored upstream crates are not ours to reformat). - prettier/treefmt in the sandbox also missed the repo-root .editorconfig ([*.md] max_line_length=off drives prettier's markdown print width); add pkgs/id/.editorconfig mirroring the root rules so the standalone flake formats identically in the sandbox and in a working tree. Verified: nix build of rustfmt/shfmt/shellcheck/taplo/prettier/ statix checks all pass on the fixed tree; treefmt --ci passes (0 changed) with the flake's formatter set - its nix build is blocked locally only by the sandbox symlinked-store purity failure in the bun2nix dependency, which does not occur on CI runners. Negative tests: a deliberately mis-formatted .rs/.sh/.toml/.md and a statix-flagged .nix each make the corresponding check fail.
There was an error while loading. Please reload this page.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Formatting rules and exclusions pkgs/id/.editorconfig, pkgs/id/Cargo.toml, pkgs/id/treefmt.toml |
The package adds EditorConfig defaults and file-specific overrides, excludes vendor/** from treefmt, and reformats two dependency declarations without changing their versions or features. |
Formatter and lint check enforcement pkgs/id/statix.toml, pkgs/id/flake.nix |
Statix configuration disables repeated_keys, sets the Nix version to 2.23, and ignores .direnv. The treefmt, rustfmt, shfmt, shellcheck, taplo, and Prettier checks now propagate failures. The Statix check records failures across files and fails after checking them all. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
ee27bThe PR makes the intended checks enforceable without identified merge-blocking risk.
Explanation
Directly linked issue #702 has four acceptance criteria. Each maps to the reviewed head as follows.
No || true on a formatter command in the check derivations. The head diff of pkgs/id/flake.nix removes all seven || true guards: treefmt-check, rustfmt-check, statix-check, shfmt-check, shellcheck-check, taplo-check, and prettier-check. The PR reports that a grep returns no hits. I did not read the full file, so this rests on the diff plus the author's grep report.
Statix collects failures across files. The new loop sets fail=1 on any statix check failure. It feeds files through process substitution so the flag survives. It ends with false when fail is nonzero. This matches the structural fix that #702 requests.
Each check is enforcing and fails on violations. Each buildPhase now runs its tool without a swallowing guard. shellcheck uses --severity=warning, which the census in the flake.nix comment supports: 4 info findings, 0 warning or above. treefmt.toml excludes vendor/**, so treefmt processes the remaining tree. The Cargo.toml taplo formatting fix supports the treefmt pass.
Violation census recorded. The PR description contains a per-tool census table. The shellcheck census also appears in a flake.nix comment. #702 requires this record.
The negative tests (mis-formatted .rs, .sh, .toml, .md, a SC2164 shell bug, and a statix-flagged .nix) were run in a scratch copy. No such tests are committed. The nix build results (six checks PASS, treefmt --ci PASS with 0 changes) are author-reported. I did not re-execute builds. The code changes are consistent with those results.
Explanation
The PR changes five files. Each change ties to the #702 objective of making the seven checks enforce.
|| true guards, the statix loop fix, and the shellcheck severity setting. These directly implement #702.vendor/** to the global excludes, with a comment. The vendored upstream crates would otherwise fail treefmt. The taplo-check and rustfmt-check still scan vendored files, so this exclusion narrows only the treefmt formatter scope. The PR gives a concrete reason for the exclusion.No change addresses unrelated functionality. The raw summary lists no changes outside these five files.
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (5 skipped: 5 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
id(ci): seven pkgs/id flake checks can never fail — treefmt/rustfmt/statix/shfmt/shellcheck/taplo/prettier buildPhases end in '|| true'
There was an error while loading. Please reload this page.