Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Inputs: names starting with '-' become tool options, --static with --invoke runs a tool twice, missing inputs found late

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
50/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
cpp
领域
cli, devtools

调研方向

Start with src/Process/Tools/FlawfinderToolImplementation.cpp near line 18 and include/Process/Tools/AnalysisTools.hpp lines 212-213, where input paths are passed to tools without a -- separator, and compare with how the cppcheck and runtime-analyzer paths are built. Then find where --static and --invoke selections are combined, and check the input-resolution step for missing files and --compile-commands. Done means each acceptance item in the issue has a test: a -x.c input is analyzed, cppcheck runs once, and a missing path exits 1 with that path named.

由索引模型根据 Issue 内容生成。

描述

bug severity/minor

Three problems with how inputs reach the tools, found by the resilience campaign (docs/quality/resilience.md).

1. File names that start with - are read as options (C37)

ctrace --input ./-F.c --invoke flawfinder

The path is normalized to -F.c and passed to flawfinder as an argument, which reads it as an option: *** getopt error: option -. not recognized, exit 3. A repository can name its files freely, and flawfinder and ikos have options that write files. src/Process/Tools/FlawfinderToolImplementation.cpp:18 and include/Process/Tools/AnalysisTools.hpp:212-213 pass paths without a -- separator; cppcheck and tscancode use --file-list, and the runtime analyzer already passes --.

Fix: pass -- before the file paths, or ./ before a path that starts with -.

2. --static with --invoke runs a tool twice (C36)

ctrace --input ok.c --static --invoke cppcheck runs cppcheck twice and counts each of its findings twice.

Fix: merge the selections into one set of tools before running them.

3. Missing inputs are found late (C07, C08, C23)

A missing input file is passed to the tools, which fail: the run ends with exit 3, "cppcheck could not run", instead of saying that the file does not exist. A --compile-commands that does not exist gives "No input files resolved" without naming it.

Fix: check that each input exists before running any tool, and exit 1 naming the missing path.

Acceptance

  • An input named -x.c is analyzed by every tool.
  • --static --invoke cppcheck runs cppcheck once.
  • A missing input or compile database exits 1 with its path in the message.
  • A test for each.
主要语言
C++
星标
5
派生
4
平均合并
1 小时 57 分钟
30 天内合并 PR
88

环境准备

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

从这里开始

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

CoreTrace/coretrace 的其他 Issue

查看 CoreTrace/coretrace 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

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