New rule: `unnecessary-analysis-test-within-option`
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 38/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 领域
- tooling
调研方向
从提供的测试用例和无更改测试用例开始,并考虑对 #587 的测试用例代码块语法的依赖。完成的标准是:规则只移除不必要的 @within 选项,同时保留必要的选项,正如两个示例所示。
由索引模型根据 Issue 内容生成。
描述
Rule summary
In #lang resyntax/test, the @within option for analysis-test: is used to narrow the scope of a following @inspect option. However, it's only necessary if the @inspect option is ambiguous if its scope isn't narrowed. There should be a refactoring rule that removes unnecessary @within options.
Test case
#lang resyntax/test
test: "unnecessary @within option can be removed"
|--------------------
| #lang resyntax/test
| analysis-test: "unused positional argument in module-level function"
| - (define (f x y) x)
| @within - (f x y)
| @inspect - y
| @property usage-count
| @assert 0
|====================
| #lang resyntax/test
| analysis-test: "unused positional argument in module-level function"
| --------------------
| (define (f x y) x)
| (f 1 2)
| --------------------
| @inspect - y
| @property usage-count
| @assert 0
|--------------------
No-change test case
#lang resyntax/test
no-change-test: "necessary @within not removable"
|--------------------
| #lang resyntax/test
| analysis-test: "unused positional argument in module-level function"
| - (define (f x y) x)
| @within - (f x y)
| @inspect - x
| @property usage-count
| @assert 1
|--------------------
Additional context
This came up while I was reviewing #556, in which copilot used @within unnecessarily a few times. Also, this depends on #587 for the test case code block syntax.
- 主要语言
- Racket
- 星标
- 70
- 派生
- 11
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
jackfirth/resyntax 的其他 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 68/100
-
documentation
难度 4/5 3-5 天 新手友好度 45/100
-
testing
难度 4/5 3-5 天 新手友好度 45/100
-
testing
难度 3/5 1-2 天 新手友好度 75/100
-
testing
难度 4/5 3-5 天 新手友好度 68/100
查看 jackfirth/resyntax 的全部 Issue
相似的 Issue
-
kaliscan.com 未关闭N: AdGuard for iOS P3: Medium T: Ads
难度 2/5 1-3 小时 新手友好度 68/100
AdguardTeam/AdguardFilters#242501 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
-
[BUG] createTool tools cannot be registered with Mastra when exactOptionalPropertyTypes is enabled 未关闭customer-eng status: needs triage
难度 2/5 1-3 小时 新手友好度 84/100
-
add-toolnames MCP Toolnames Toolnames checkup
难度 2/5 1-3 小时 新手友好度 68/100
rajbos/ai-engineering-fluency#2190 · 3 条评论 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
gajus/eslint-plugin-jsdoc#1776 · 1 个 reaction ·