docs(tests): complete the retired-invocation guard's scope declaration - #121
Merged
Merged
Conversation
#119 added the WHAT IT STILL CANNOT SEE section and thereby made a claim about this guard's reach. The claim listed two blind spots; there are four. The suffix filter and the tests/ exclusion were both already there before #119 - the rglob version had the same filter - so this is not a regression, but the commit that declares a scope owns the completeness of that declaration. The third one has live instances rather than hypothetical ones. deploy/systemd/quant-data-update.service exists for the sole purpose of naming a command to run, and pyproject.toml can do the same; neither is scanned. Wiring a retired tool into a unit file would not turn this red. Widening the suffix set would change what the guard reaches, which is a different act from describing what it reaches, so it is not done here and the docstring says so. Verified rather than asserted: an untracked .md probe still turns it red, and an untracked .sh probe with identical content leaves it green, which is exactly what blind spot 3 now claims.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#119 新增了
WHAT IT STILL CANNOT SEE一节、从而对这个守卫的射程作出了声明。该声明列了两条盲区,实际有四条。补的两条
③ 文件类型过滤器(
{.py, .md, .yaml, .txt}之外一律不扫)—— 这条有实际实例,不是假想:deploy/systemd/quant-data-update.service的全部存在意义就是写一条要跑的命令(ExecStart=)pyproject.toml同样可以把某个退役工具接进 unit 文件或 pyproject entry point,这个守卫不会响。
④
tests/排除 —— 因为RETIRED_INVOCATIONS常量自身住在那里、会自我命中。代价是测试文件里的退役调用同样看不见,此前未声明。定性
suffix 缺口是既有的、不是 #119 引入的(
rglob版本有同样的过滤器)。但作出射程声明的那个 commit,要为该声明的完整性负责——这是本仓「守卫的射程要写进它自己的 docstring」那条规矩的另一半:声明得太宽是缺陷,声明得不全同样是。不做的事
不扩 suffix 集。 那会改变守卫够得到什么,与描述它够得到什么是两回事 —— 属另一件事、要自带自己的证据,docstring 里已写明这一点。
验过,不是断言
.md.shtests/test_hand_anchor_record.py23 passed,ruffclean,改动仅 docstring。