Duplicate autogen.sh entry in commoncode default ignores
维护者通常 3 天内回复
评估
调研方向
检查 src/commoncode/ignore.py,找到第 204-205 行附近的 default ignores dict,其中 "autogen.sh" 出现了两次。从这里开始,删除一个重复条目,使每个键只列出一次。使用提供的命令 grep -n '\"autogen.sh\"' src/commoncode/ignore.py 或报告中的 AST 重复键代码片段进行验证;当重复行已被删除且没有报告重复键时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Description
src/commoncode/ignore.py lists the same key twice in the default ignores, on two byte-identical consecutive lines (204-205):
"autogen.sh": "Default ignore: autotools artifact",
"autogen.sh": "Default ignore: autotools artifact",
Nothing misbehaves here — the key and the value are identical, so the dict ends up the same either way. It is just a dead line, and filing it as a small cleanup rather than a bug.
How To Reproduce
$ grep -n '"autogen.sh"' src/commoncode/ignore.py
204: "autogen.sh": "Default ignore: autotools artifact",
205: "autogen.sh": "Default ignore: autotools artifact",
import ast, collections
src = open('src/commoncode/ignore.py').read()
for node in ast.walk(ast.parse(src)):
if isinstance(node, ast.Dict):
counts = collections.Counter(
k.value for k in node.keys
if isinstance(k, ast.Constant) and isinstance(k.value, str)
)
for key, n in counts.items():
if n > 1:
print(f'line {node.lineno}: duplicate key {key!r} x{n}')
line 185: duplicate key 'autogen.sh' x2
Suggested fix
Delete one of the two lines. PR attached.
System configuration
- What OS are you running on? Linux (x86_64)
- What version of scancode-toolkit was used? 33.0.0rc1,
developat 5ebebf2 - What installation method was used to install/run scancode? source checkout
- Python version: 3.x
- 主要语言
- Python
- 星标
- 2.7k
- 派生
- 831
- 平均合并
- 3 天 4 小时
- 30 天内合并 PR
- 7
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aboutcode-org/scancode-toolkit 的其他 Issue
-
bug: Unreachable JSON extension and format validation in validate_input_path可能已有人在做 @0Cymantek0 于 18 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
aboutcode-org/scancode-toolkit#5351 · 1 条评论 ·
维护者通常 3 天内回复
-
CycloneDX output: metadata.properties[].value emits JSON array instead of string可能已有人在做 @0Cymantek0 于 17 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
aboutcode-org/scancode-toolkit#5349 · 1 条评论 ·
维护者通常 3 天内回复
-
Duplicate 'COPYLEFT' entries in legal file classification names in legal.py and classify.py可能已有人在做 @Pradeepbeleri 于 45 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
aboutcode-org/scancode-toolkit#5319 · 2 条评论 ·
维护者通常 3 天内回复
-
Duplicate LGPL key in rubygems LICENSES_MAPPING makes one mapping unreachable可能已有人在做 @Daksha1611 于 48 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
aboutcode-org/scancode-toolkit#5314 · 1 条评论 ·
维护者通常 3 天内回复
-
Duplicate keys in alpine DECLARED_TO_SPDX silently discard two license mappings可能已有人在做 @Daksha1611 于 48 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 82/100
aboutcode-org/scancode-toolkit#5312 ·
维护者通常 3 天内回复
查看 aboutcode-org/scancode-toolkit 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 68/100
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
ClockGU/clockwork-backend#169 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
aws-samples/sample-per-model-bedrock#616 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
chnm/teachinghistory-hugo#47 ·
-
good first issue
难度 2/5 1-3 小时 新手友好度 67/100
pandas-dev/pandas-stubs#2047 · 2 条评论 ·
维护者通常 1 天内回复