hujsonfmt: -w rewrites already formatted files and -l lists them
まだ誰も着手していません。
評価
調査の方向性
cmd/hujsonfmt/hujsonfmt.goを読み、特にprocessFileとprocessSrcを確認してください。-lと-wの両方について、元のsrcとフォーマット後の出力を比較してください。次に、すでにフォーマット済みのファイルは一覧に表示も再書き込みもされず、未フォーマットのファイルは更新されることを確認してください。Issueには、動作を検証するための再現可能なコマンド手順が記載されています。
索引モデルが issue の本文から書いたものです。
説明
hujsonfmt -w rewrites a file that is already formatted, and hujsonfmt -l lists it as unformatted.
Steps, with hujsonfmt 0-unstable-2025-06-05 from nixpkgs on Linux; cmd/hujsonfmt/hujsonfmt.go at b80ff77 has the same code:
printf '{\n\t"a": 1,\n}\n' > policy.hujson
hujsonfmt -w policy.hujson # formats it
hujsonfmt policy.hujson | diff - policy.hujson # no output: already formatted
hujsonfmt -w policy.hujson # mtime changes again
hujsonfmt -l policy.hujson # prints policy.hujson
processFile passes input to processSrc, which can modify it in place, so the -l case compares the modified input with the output instead of src. The -w case calls writeFile without comparing at all, so every run writes a backup copy and rewrites the file. Formatters such as treefmt then report the file as changed on every run.
Would a fix that compares src with the output in both cases, and skips the write when they are equal, be welcome?
- 主要言語
- Go
- スター
- 892
- フォーク
- 40
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tailscale/hujson のほかの issue
-
Standardize modifies its input slice; the doc comment does not say so対応中かも @jihtsan が 29 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 60/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
Value.Patch: "add" with an out-of-range array index appends instead of failing対応中かも @SashaMIT が 32 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Value.Patch: "test" operation always fails for a null value対応中かも @RaphaelFakhri が 34 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
Patching with comments対応中かも @Shubham-Padkonde が 47 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
tailscale/hujson の issue をすべて見る
似ている issue
-
area: interop area: sip-core v3
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
fonoster/routr#705 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
deadfin-org/deadfin#35 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
enhancement priority: low
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
labmonkeys-space/nl6#1037 ·
メンテナーはふだん 1 日以内に返信
-
Setup Guide Go tab: say it needs Go 1.26 (the unversioned go get pulls OpenTelemetry Go v1.47.0)オープンenhancement follow-up
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信