Per-flag behaviour is spread over seven name-keyed maps with one guard test
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 75/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go
調査の方向性
internal/cli/config.go、internal/cli/resume.go、internal/cli/completion.go のフラグマップを読み、既存のガードである internal/cli/config_test.go:318-328 を確認してください。各指定フラグが登録されていることと、pacingFlags が IsBoolFlag と一致することを確認するチェックを追加し、go test ./internal/cli/ を実行してください。完了条件は、ガードが列挙されたすべてのマップを対象とし、bool の重複定義が削除されていることです。
索引モデルが issue の本文から書いたものです。
説明
Summary
What each CLI flag does in config files, env vars, resume and shell completion is spread over seven maps keyed by flag name, in three files. Only one of the maps has a test that its keys are real flags, so a misspelled or stale name in any of the others silently does nothing.
Where
internal/cli/config.go:39,43,49(noDefaultFlags,listFlags,repeatFlags)internal/cli/resume.go:219,225-228(unsavedSettings,pacingFlags)internal/cli/completion.go:23-26,34-37(fileFlags,valueChoices)internal/cli/config_test.go:318-328(the only name-validity guard, forfileFlags)
Details
Each of these is a map[string]bool (or similar) keyed by the flag's name. The bool value in pacingFlags restates whether the flag is boolean, which completion.go:52 already derives from IsBoolFlag.
Impact
Each new flag means deciding from memory whether it belongs in up to seven maps:
- missing from
pacingFlags:-resumerefuses the flag - missing from
unsavedSettings: resume refuses a harmless difference - a mode flag missing from
noDefaultFlags: it becomes settable fromSUBENUM_*env
Renaming a flag leaves dead keys behind, with no test failure.
Suggested fix
Each step leaves the code working:
- Add a test that every key of
noDefaultFlags,listFlags,repeatFlags,unsavedSettings,pacingFlagsandvalueChoicesis a registered flag (copy the second loop ofconfig_test.go:326), and thatpacingFlags' bool equals the flag'sIsBoolFlag. This alone catches renames and can ship on its own. - Make
pacingFlagsa set and readIsBoolFlagfrom the FlagSet atresume.go:337. - Optional: one
flagTraitstable in one file, with the seven maps as thin accessors, migrating one map per commit.
Tests to have in place first: the resume tests for pacing flags, the config-file list/repeat tests, the completion output tests, and the new test from step 1.
Acceptance criteria
- A test fails when any trait map names a flag that is not registered
-
pacingFlagsno longer duplicatesIsBoolFlag
Getting started
- Relevant files:
internal/cli/config.go,internal/cli/resume.go,internal/cli/completion.go,internal/cli/config_test.go - How to run tests:
go test ./internal/cli/
Filed by repo-audit/full-audit at dd5b156. Severity: medium. Effort: S (steps 1-2), M (step 3). audit-key: tech-debt|internal/cli/config.go|noDefaultFlags
- 主要言語
- Go
- スター
- 1
- フォーク
- 1
- 平均マージ
- 7時間 18分
- マージ済み PR(30日)
- 23
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TMHSDigital/subenum のほかの issue
-
severity: low tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
TMHSDigital/subenum#414 ·
メンテナーはふだん 1 日以内に返信
-
area: tui good first issue severity: low testing
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
TMHSDigital/subenum#413 ·
メンテナーはふだん 1 日以内に返信
-
good first issue severity: low testing
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
TMHSDigital/subenum#412 ·
メンテナーはふだん 1 日以内に返信
-
good first issue performance severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
TMHSDigital/subenum#411 ·
メンテナーはふだん 1 日以内に返信
-
bug github-actions good first issue severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
TMHSDigital/subenum#407 ·
メンテナーはふだん 1 日以内に返信
TMHSDigital/subenum の issue をすべて見る
似ている issue
-
Client execution contract accepts a grant the code never takes対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea: client enhancement priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
opensro-dev/opensro#3808 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
-
hive size:simple
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
Edwin-metcalf/MetCode#54 ·
メンテナーはふだん 1 日以内に返信
-
gen ctrl: appends duplicate parameterless NewV1()/ControllerV1 when the existing NewV1 takes parameters対応中かも @Lizjunn が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信