Skip to content

docs: fix stale commands in binary cataloger README#5047

Open
alliasgher wants to merge 1 commit into
anchore:mainfrom
alliasgher:docs-binary-cataloger-readme
Open

docs: fix stale commands in binary cataloger README#5047
alliasgher wants to merge 1 commit into
anchore:mainfrom
alliasgher:docs-binary-cataloger-readme

Conversation

@alliasgher

Copy link
Copy Markdown

Description

The binary classifier cataloger developer README (syft/pkg/cataloger/binary/README.md) documents several commands that no longer match the code:

  • Testing command was wrong. It showed go test -must-use-full-binaries ./syft/pkg/cataloger/binary/testdata/..., but the flag is defined as -must-use-original-binaries (in classifier_cataloger_test.go) and Test_Cataloger_PositiveCases lives in the binary package, not under testdata/. Fixed the command and added a single-fixture variant.
  • add-snippet invocation. Replaced the stale go run ./manager add-snippet references with the make add-snippet target, and noted that the (Y/n/q) prompt requires y to write the snippet.
  • Test file name. The TL;DR pointed at ../cataloger_test.go; the test actually lives in ../classifier_cataloger_test.go.
  • Capabilities regeneration. Documented the go generate ./internal/capabilities step (run from the repo root, commit the regenerated capabilities.yaml) for when a new classifier is added.

Commands were verified against main (the -run Test_Cataloger_PositiveCases/<name> -must-use-original-binaries form runs the expected cases; the flag and file paths were checked in the source).

Fixes #4510

Type of change

  • Bug fix (non-breaking change which fixes an issue) — documentation correction

Update the binary classifier cataloger developer README to match the
current workflow:

- Testing section used the non-existent flag -must-use-full-binaries
  against .../testdata/...; the real flag is -must-use-original-binaries
  and Test_Cataloger_PositiveCases lives in the binary package. Fix the
  command and add a single-fixture variant.
- Point add-snippet references at the make target and note the (Y/n/q)
  prompt requires y to write the snippet.
- Fix the test file name (classifier_cataloger_test.go) and document the
  go generate ./internal/capabilities step for new classifiers.

Fixes anchore#4510

Signed-off-by: alliasgher <alliasgher123@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

update README.md about binary classifier cataloger

1 participant