CLI edge cases: rules accepts stray flags, locale-dependent sort, --fix scope

オープン
#109 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript
領域
cli, testing, tooling

調査の方向性

Start with the listed sections of src/cli.ts, src/lint/project.ts, src/baseline.ts, and src/lint/rules/stringly-nodepath.ts, then inspect related cases in test/cli.test.ts. Run npm run build && npm test to see the current behavior. Done means each listed edge case has a documented decision or code change and a test; the issue describes several interacting CLI and fix-policy decisions.

索引モデルが issue の本文から書いたものです。

説明

severity: low tech-debt

Summary

Small CLI edge cases left over after the strict-arguments work (#68) and the new --fix flag.

Where

  • src/cli.ts:315 (rules returns before any flag validation)
  • src/cli.ts:75-77, src/lint/project.ts:39-41, src/baseline.ts:69-71 (localeCompare with no fixed locale)
  • src/lint/rules/stringly-nodepath.ts:30-41, src/cli.ts:353-357 (--fix scope)

Details and checklist

  • gdcorrect rules silently accepts --fail-on bogus, --fix, --files, --baseline and --write-baseline. That contradicts the strict-CLI contract. Reject flags that do not apply to rules, with exit 2.
  • Sorting with a.localeCompare(b) and no fixed locale makes output order, and the order of entries in a written baseline file, depend on the machine's ICU locale. That can cause baseline diffs between developers and CI. Use a plain code-unit comparison, or localeCompare(b, "en").
  • The stringly-nodepath fix rewrites get_node("A/B") to $A/B. That is the same literal path, which the finding itself calls rename-fragile, so the fix hides the finding without addressing it. --fix also applies every attached fix regardless of severity. Either:
    • reword the rule as a style preference, or
    • add --fix-rule <id>, or limit --fix to findings at or above --fail-on.
  • --fix runs before the baseline filter (cli.ts:353-364), so baselined findings are rewritten too. Decide whether that is intended, and document or change it.

Acceptance criteria

  • Each item above is either changed or documented, with a test.

Getting started

  • Relevant files: src/cli.ts, src/lint/project.ts, src/baseline.ts, test/cli.test.ts
  • How to run tests: npm run build && npm test

Filed by repo-audit/full-audit at e836036. Severity: low. Effort: S. audit-key: quality|src/cli.ts|misc

主要言語
TypeScript
スター
0
フォーク
6
平均マージ
1日 21時間
マージ済み PR(30日)
8

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/godot-correctness-mcp のほかの issue

TMHSDigital/godot-correctness-mcp の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。