Repository navigation
build(hooks): format Markdown with dprint instead of prettierd - #139
Conversation
prettierd starts a never-exiting daemon per cwd, and orphans piled up across worktrees. dprint-plugin-markdown (listIndentKind, 0.22.0+) can now keep 4-space nested lists, so route Markdown through the same dprint policy as JSON/TOML and drop the prettier plumbing. Also pass the target as a positional file instead of --includes-override: with the bundled config the override resolved against the config directory and silently matched no files. Closes #135 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
| PERSONAL_DPRINT_CONFIG_NAME = "dprint.json" | ||
| PERSONAL_PRETTIER_CONFIG_NAME = ".prettierrc" | ||
| PERSONAL_CONFIG_NAMES = frozenset({PERSONAL_DPRINT_CONFIG_NAME, PERSONAL_PRETTIER_CONFIG_NAME}) | ||
| PERSONAL_CONFIG_NAMES = frozenset({PERSONAL_DPRINT_CONFIG_NAME}) |
There was a problem hiding this comment.
P2 — If you drop .prettierrc from PERSONAL_CONFIG_NAMES, project_files will start treating ~/.prettierrc as a real project declaration whenever the walk reaches $HOME. That breaks more than Markdown: dprint_plan runs for JSON and TOML too, so for anyone who still has the ~/.prettierrc that the dotfiles installed, every JSON, TOML or Markdown edit under ~ without a nearer config now returns Lint/format unavailable … takes precedence over dprint and nothing gets formatted. The PR description only mentions Markdown, and the fix depends on a separate dotfiles change (#435) landing first. Consider keeping .prettierrc in the home exclusion set, or at least ignoring it at $HOME, until that change has shipped.
| Step("prettierd format", ("prettierd", filename), writes_stdout=True, mutates=True), | ||
| ) | ||
| """Fix spacing with autocorrect, then format with dprint under the JSON/TOML policy.""" | ||
| return (Step("autocorrect format", ("autocorrect", "--fix", str(path)), mutates=True), *dprint_plan(path)) |
There was a problem hiding this comment.
P2 — Sending Markdown through dprint_plan means it also inherits the OTHER_FORMATTER_CONFIG_NAMES gate, and that gate includes biome.json and biome.jsonc. Biome does not format Markdown. So in any Biome project, every .md edit now gets Lint/format unavailable — Project formatter declaration biome.json takes precedence over dprint, and the file is never formatted. Before this change, prettierd formatted it. For Markdown, only prettier declarations should yield the policy step, or Biome configs should be skipped for md. There's a test for the .prettierrc case but none for biome.json + .md.
Review summaryNo blocking issues. Moving from prettierd to dprint, and passing the target as a positional argument instead of P2 findings (inline):
Side note, not a separate finding: a personal |
…ring home .prettierrc Biome does not format Markdown, so only prettier declarations should make the Markdown plan defer. A leftover personal ~/.prettierrc must not shadow dprint for JSON, TOML, or Markdown under $HOME. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Review summaryNo blocking findings, and nothing rose above the bar for an inline comment. What I checked:
Behaviour changes to be aware of (intended, not bugs):
I could not run dprint locally, so I did not check the positional-argument semantics against a real binary. |
Closes #135
概要
Markdown の lint/format hook を
prettierdからdprint(dprint-plugin-markdown 0.29.0,listIndentKind: pythonMarkdown,textWrap: maintain)へ移す.prettierdは cwd ごとに終了しないデーモンを起動し,worktree ごとに孤児が溜まっていた.dprint は常駐しない.変更
markdown_plan:autocorrect→ 既存のdprint_plan(プロジェクトの dprint 設定が優先,prettier 設定があれば policy step)defaults/dprint.json: markdown プラグインとmdの include を追加PRETTIERD_DEFAULT_CONFIG,PERSONAL_PRETTIER_CONFIG_NAME,defaults/prettier.json,command_permissions.jsonのprettierd--includes-override <相対パス>が設定ディレクトリ基準で解決され,--allow-no-filesにより何も整形されなかった(JSON/TOML も同様).対象ファイルを位置引数で渡すよう変更実測
dprint.jsonに markdown プラグインが無い場合: エラーなし(exit 0),整形されない(no-op).テストで固定~/.prettierrcはホーム直下の設定として無視する(dotfiles 側の削除までの暫定).Markdown では Biome 設定を競合とみなさないテスト
uv run pytest: 4541 passed, 1 skipped.ruff format --check/ruff check通過.🤖 Generated with Claude Code