Code scanning adapts to the repository #344

closed cmc opened this on 2026-11-01 05:52 UTC

Discussion

cmc 2026-11-01 05:52 UTC

The first scans (#340) reported 651 findings across 33 repositories; about 20 were real. The rest have no way out except nosemgrep comments or rewrites in each repository, which every user of the instance would have to repeat.

  • Rules for a library apply only where it is used. Findings from opengrep-rules' library directories (python/django, python/flask, python/requests, javascript/jquery, typescript/react/portability/i18next, …) are dropped when the scanned commit's manifests do not name the library; yaml/semgrep lints apply only to repositories that author rules. Counted, not hidden: status says how many were left out and why.
  • Dismissal. repo security dismiss <owner/name> <fingerprint>… --reason false-positive|wont-fix|test, repo security reopen. Stored by fingerprint, so it survives line moves; the issue lists open findings only and closes when none are left.
  • Repository settings. repo settings security-ignore (path globs, as secret-scan-allow) and security-exclude-rule (a rule id or family). Paths marked linguist-vendored or linguist-generated in .gitattributes are ignored without configuration.
  • Fingerprints keep distinct hits apart. The fingerprint leaves out the line, so every hit of one rule in one file with the same message collapses into one finding: the issue undercounts, and fixing the listed hit surfaces the next. Use the tool's own fingerprint when the SARIF has one, otherwise the matched snippet and an occurrence index.

closed by cmc in commit 96f3442ce1: Code scanning sets aside what does not apply; dismissals

2026-11-01 06:09 UTC

referenced in commit 359b4a6fb4 by cmc: codescan: keep hits of one rule in one file apart

2026-11-01 06:09 UTC