Skip to content

feat: detect_linter_config 由 languages.json 派生 (v0.6.5) - #13

Merged
loong10k merged 1 commit into
mainfrom
feat/linter-config-from-registry-v0.6.5
Sep 22, 2026
Merged

loong10k merged 1 commit into
mainfrom
feat/linter-config-from-registry-v0.6.5

Conversation

@loong10k

Copy link
Copy Markdown
Contributor

What

  • env_check.py SessionStart 钩子改从 languages.json 读 linter_config_files
  • languages.json:java/rust/typescript/python 4 条已迁移字段
  • 校验器加 _check_linter_config_files 规则
  • +2 反例测试
  • spec: registry-driven-config (2 Requirements)

Why

MEDIUM #8: 原 LINTER_CONFIG_FILES 仅覆盖 4 语种;新增语言需同步改 env_check。
现由 registry 驱动,加语言时只需填字段。

Verification

  • unittest 26/26
  • run_all 141/141/0
  • validator 0 errors
  • git diff --check clean

M8 改进 env_check.py 的 SessionStart 盘点:每种语言的 linter 配置文件路径
从硬编码常量 LINTER_CONFIG_FILES(仅 4 语言)改为从 languages.json 读取
新字段 linter_config_files。注册表新增 4 条语言(java/rust/typescript/python)
的字段值;其它语言保持空数组(向后兼容)。

变更:
- hooks/env_check.py:删 LINTER_CONFIG_FILES 常量 + 加 REGISTRY import
  + detect_linter_config body 改为迭代 REGISTRY
- scripts/languages.json:4 条已迁移语言的 linter_config_files 字段
- scripts/validate_languages_json.py:_check_linter_config_files 新规则
- tests/test_validate_languages_json.py:+2 反例
- spec: registry-driven-config (2 Requirements) 已合入

行为不变:现有 4 语言下 env_check 输出与 v0.6.4 完全一致;其它语言
继续不报告(向后兼容)。

校验:unittest 26/26 + run_all 141/141/0 + validator 0 errors + diff clean

实现定位:
- env_check.detect_linter_config: hooks/env_check.py:43
- languages.json 字段路径:scripts/languages.json java/rust/typescript/python
- 校验规则:scripts/validate_languages_json.py:_check_linter_config_files
@loong10k loong10k added the enhancement New feature or request label Sep 22, 2026
@loong10k
loong10k merged commit b4312c1 into main Sep 22, 2026
1 check passed
@loong10k
loong10k deleted the feat/linter-config-from-registry-v0.6.5 branch September 22, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant