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

未关闭
#109 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
领域
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 小时
30 天内合并 PR
8

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TMHSDigital/godot-correctness-mcp 的其他 Issue

查看 TMHSDigital/godot-correctness-mcp 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。