Skip to content

ci(dprint): check every tracked file in the format-check job - #448

Merged
furedea merged 2 commits into
mainfrom
ci/check-every-tracked-file-with-dprint
Nov 10, 2026
Merged

furedea merged 2 commits into
mainfrom
ci/check-every-tracked-file-with-dprint

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

概要

CI の dprint ステップが tracked の JSON/TOML/Markdown をほぼチェックしていなかった問題を修正する.

原因は設定ファイルが dprint/ サブディレクトリにあり,dprint が includes を設定ファイルのディレクトリ基準で解決することだった.対象は dprint/dprint.json 自身の 1 ファイルだけになっていた.回避スクリプトではなく,設定をリポジトリのルートへ移して原因を取り除く.

変更内容

項目 before after
設定の場所 dprint/dprint.json ./dprint.json
~/dprint.json dprint/dprint.json へのリンク ./dprint.json へのリンク(中身は同じ)
CI dprint check --config dprint/dprint.json dprint check --incremental=false
lefthook --config ~/dprint.json リポジトリの設定を自動検出
  • nix/home/default.nix のリンク元,README の表,tests/esa/format.bats の参照を更新
  • git grep "dprint/dprint.json" は 0 件

不採用にした案

  • git ls-files を位置引数で渡すスクリプトと専用 bats: 原因を残したままの回避策になる
  • ルートに extends だけの設定を置く: dprint が extends 先の includes を拒否する(Unexpected non-string, boolean, or int property (includes))

証拠

項目 before after
dprint output-file-paths(リポジトリルート) 1 件(dprint/dprint.json) 60 件
git ls-files '*.json' '*.toml' '*.md' との差分 - なし
  • 崩した tracked ファイルを置くと dprint check --incremental=false が exit 20 で失敗することを確認
  • 対象の 60 件はすべて整形済みで,excludes の追加は不要
  • nix flake check が成功(Home Manager のリンクが評価できる)
  • tests/esa/format.bats 3 件が成功

Closes #439

🤖 Generated with Claude Code

@furedea

furedea commented Nov 10, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-10T17:55:37.653484Z
We couldn’t complete this review. Comment @codex review to try again.
897a953 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

Copy link
Copy Markdown
Contributor

Review summary

No blocking findings.

  • scripts/ci/check_dprint.sh: passing git ls-files -z | xargs -0 correctly overrides the config-relative includes. If xargs splits the list into several dprint runs, a failure in any run still gives a non-zero exit (123), and pipefail is set. The repo has no submodules or tracked symlinks, so every path is a regular file.
  • CI: dprint comes from nix/lint_tools.nix in the dev shell, so the new bats file runs in the existing bats-tests job (--recursive tests). The fixture only stages files and never commits, so it needs no git identity.
  • Tests: they cover a formatted tree passing and an unformatted JSON or Markdown file outside dprint/ failing, which is the behavior this PR changes.

🤖 Generated with Claude Code

dprint resolves includes relative to the config file's directory, so the
CI step matched only dprint/dprint.json. Placing the config at the root
makes every tracked JSON/TOML/Markdown file a target and lets CI and
lefthook auto-detect it. The ~/dprint.json link keeps the same content.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea
furedea force-pushed the ci/check-every-tracked-file-with-dprint branch from d2bc91f to 5cf67c9 Compare November 10, 2026 17:52
@furedea

furedea commented Nov 10, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Comment thread README.md
| `karabiner/karabiner.json` | `~/.config/karabiner/karabiner.json` |
| `herdr/config.toml`, `herdr/reviewr.toml` | Herdr config and reviewr plugin config |
| `dprint/dprint.json` | `~/dprint.json` |
| `dprint.json` | `~/dprint.json` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This row is updated, but the directory tree further down in the README (around line 252) still lists ├── dprint/ # Global formatter configuration. That directory no longer exists after this PR, so the tree now points at a missing path. Consider removing that entry, or replacing it with a dprint.json file entry.

@github-actions

Copy link
Copy Markdown
Contributor

Review summary

No blocking findings.

Moving the config to the repository root fixes the root cause: dprint resolves includes relative to the config file, so CI was effectively checking only one file. The other changes are consistent with the move:

  • CI and lefthook now pick up the root dprint.json automatically.
  • The Home Manager mkOutOfStoreSymlink now points at the new path, and the file content is unchanged, so ~/dprint.json and the Neovim fallback behave as before.
  • tests/esa/format.bats references are updated, and no dprint/dprint.json references remain.

Findings:

  • P3 README directory tree still lists the removed dprint/ directory (inline comment).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 10, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

Copy link
Copy Markdown
Contributor

Review summary

No findings. I checked these:

  • No references to dprint/dprint.json or the dprint/ directory remain. That covers workflows, Nix, Lua, the bats tests and the scripts.
  • The CI job has no path filters that point at the old location.
  • dprint check --incremental=false now finds the root dprint.json on its own, and includes resolves from the repo root.
  • The lefthook dprint check {all_files} now uses the repo config, so it no longer depends on the ~/dprint.json link being installed.
  • The Home Manager link now points to the new path, and its contents haven't changed. Neovim's fallback to ~/dprint.json still works.
  • The updated tests/esa/format.bats paths match the new location.

Blocking findings (P0/P1): 0

@furedea
furedea merged commit 4512746 into main Nov 10, 2026
19 of 21 checks passed
@furedea
furedea deleted the ci/check-every-tracked-file-with-dprint branch November 10, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(dprint): check every tracked file instead of only the config itself

1 participant