Skip to content

Batch: 3 fixes, one commit each - #59

Merged
thebenignhacker merged 3 commits into
mainfrom
integrate/2026-10-21-r8
Oct 21, 2026
Merged

thebenignhacker merged 3 commits into
mainfrom
integrate/2026-10-21-r8

Conversation

@thebenignhacker

Copy link
Copy Markdown
Member

This pull request lands 3 commits in pkg/scanner, pkg/reporter, internal/cli, docs and the changelog.

Included

Verified on this exact tree

  • go build -p 4 ./...: exit 0
  • go vet -p 4 ./...: exit 0
  • golangci-lint run --concurrency 4 (golangci-lint 2.12.2, no repository config): exit 1, 21 issues (errcheck 15, staticcheck 6); the same command on a detached worktree of origin/main at 05a3f86: exit 1, 21 issues (errcheck 15, staticcheck 6), pre-existing
  • changelog check: the repository has no changelog check script
  • go test -race -p 4 -json ./...: exit 0; 9 packages, 8 pass, 1 with no test files; named tests including subtests: 1168 passed, 0 failed, 0 skipped
  • git ls-files '*_test.go' | wc -l: 60

Not included

None

Closes

Fixes #55
Fixes #56
Fixes #58

How to merge

Rebase and merge, so that each change stays its own commit on main.

…eft out (#55)

cryptoscan pqc on a tree whose one file sits under examples/ printed
"Nothing was checked: no files were scanned under t" and nothing about
that file or --include-skipped, while cryptoscan scan on the same tree
prints "1 file in 1 directory was not scanned (default rules:
examples)." and "Scan them with --include-skipped.". The command prints
that notice on stderr for --format json and none for text, since the
scan text report prints the two lines itself; the pqc text view did not.

When the directories the default rules left out hold files, the pqc
text view now prints those two lines, the count in yellow as in the scan
report, after the readiness block and the withheld-findings note. For a
tree with one file each under examples/, fixtures/ and testdata/ it
prints "3 files in 3 directories were not scanned (default rules:
examples, fixtures, testdata)." and the hint, and writes nothing to
stderr. pqc --format json prints the same stdout and stderr as before
for that tree and for the one above.

A reporter test checks that the view prints the text report's two lines
once, for a scan with findings and for one that read no files, and
neither line when the skipped directories hold no files. A command test
runs pqc on the tree from the report in text and JSON, and with
--include-skipped, where the view lists the MD5 call. Both fail on the
previous commit. The comment above TestIncludeSkippedOnEveryCommandThatScans
now says which pqc format prints which, and the unreleased changelog
entry for --include-skipped names the pqc text view.

Fixes #55
…and out of --include-skipped (#56)

A scan of a repository URL clones the repository into a temporary
directory and walks the clone. The clone's .git directory, which git
clone creates, was counted like a .git directory inside a scanned
folder. With git 2.53.0, a scan of a repository served over HTTP whose
only file is src/a.py printed "29 files in 1 directory were not scanned
(default rules: .git)." and "Scan them with --include-skipped." in the
text report, printed the same on stderr for --format json and --format
sarif, carried it as the SARIF note, and wrote
"skipped":{"files":29,"directories":1,"rules":[".git"],"paths":[".git"]}
in JSON. gate, cbom and pqc printed the same notice. With
--include-skipped, scan read 29 files and reported findings in the
clone's .git/hooks/prepare-commit-msg.sample and .git/hooks/update.sample.

For a URL scan, the scanner now records the path of the clone's .git
directory and leaves that directory out of the walk before any default
rule is checked, so it is not counted and --include-skipped does not
walk it. On the same repository, scan, gate, cbom and pqc print no
skipped-directory notice, JSON output has
"skipped":{"files":0,"directories":0,"rules":[],"paths":[]}, and with
--include-skipped scan reads 1 file and reports findings in src/a.py
only. A local scan of a checkout still counts the checkout's .git
directory.

A scanner test serves a repository holding src/a.py and examples/b.py
over smart HTTP on the loopback interface and scans its URL: only
examples is counted, --include-skipped scans the two files and the
report names no .git path, and a local scan of the checkout lists .git
and examples. It fails on the previous commit. The changelog entry for
the skipped-directory count and the scan section of docs/commands.md
say that the clone's .git directory is neither counted nor scanned.

Fixes #56
…an report instead of reading it as source (#58)

Fixes #58
@thebenignhacker
thebenignhacker merged commit 6defd4a into main Oct 21, 2026
4 checks passed
@thebenignhacker
thebenignhacker deleted the integrate/2026-10-21-r8 branch October 21, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant