Thank you for your interest in contributing to sbomlyze! This guide covers everything you need to get started.
| Tool | Version | Install |
|---|---|---|
| Go | 1.24+ | https://go.dev/dl/ |
| golangci-lint | v1.64+ | go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8 |
| goreleaser (optional) | v2 | go install github.com/goreleaser/goreleaser/v2@latest |
git clone https://github.com/rezmoss/sbomlyze.git
cd sbomlyze
make build-quick
./sbomlyze --versioncmd/sbomlyze/ CLI entry point
internal/
analysis/ Diff engine, stats computation, dependency graphs
cli/ Argument parsing and option handling
identity/ Component identity matching (PURL, CPE, BOM-ref)
output/ Output formatters (text, JSON, SARIF, JUnit, Markdown, Patch)
pager/ Terminal pager support
policy/ Policy engine for CI/CD enforcement
progress/ Progress spinner
sbom/ SBOM format parsers (Syft, CycloneDX, SPDX)
tui/ Interactive terminal UI (Bubble Tea)
version/ Build version info
web/ Web UI server, handlers, and static assets
static/ HTML, CSS, JavaScript for the web explorer
testdata/ Test fixtures (SBOM samples, snapshots)
examples/policies/ Example policy files
Always run tests and lint before committing. CI will reject PRs that fail either check.
make testThis runs the full test suite with the race detector:
go test -v -race -count=1 ./...If you changed output formatting, update snapshots:
make update-snapshotmake lintThis runs golangci-lint with the project's default configuration:
golangci-lint run ./...Fix any issues before committing. Common lint fixes:
- Unused variables or imports: remove them
- Error return values: handle or explicitly ignore with
_ = - Formatting: run
gofmt -w .
make build-quickmake test && make lint && make build-quickOr run everything at once:
make allRun make help for a quick reference:
make all Run test, lint, and build (full CI check)
make test Run all tests with race detector
make lint Run golangci-lint
make build Build with goreleaser (snapshot)
make build-quick Quick development build (./sbomlyze)
make snapshot-test Run snapshot tests only
make update-snapshot Update snapshot golden files
make clean Remove build artifacts
make help Show this help
- Fork the repository
- Create a feature branch from
main:git checkout -b feat/my-feature
- Make your changes
- Run
make test && make lint - Commit and push
- Open a pull request against
main
| Prefix | Use |
|---|---|
feat/ |
New features |
fix/ |
Bug fixes |
refactor/ |
Code refactoring (no behavior change) |
docs/ |
Documentation only |
test/ |
Test additions or fixes |
Write clear, concise commit messages:
feat: add SARIF output format for CI integration
fix: handle empty dependency list in CycloneDX parser
refactor: extract identity matching into separate package
docs: add policy engine examples to README
test: add snapshot tests for diff output
- Use imperative mood ("add", not "added" or "adds")
- Keep the first line under 72 characters
- Reference issues when applicable:
fix: handle nil pointer in search (#42)
- Focused: One logical change per PR
- Tested: New code has tests, existing tests pass
- Linted: No lint warnings
- Documented: Update README if adding user-facing features
Include:
- What the change does and why
- How to test it
- Screenshots for UI changes (web or TUI)
- CI must pass (tests, lint, build)
- At least one maintainer review
- Address review feedback
- Squash-merge into
main
Tests live next to the code they test:
internal/sbom/parse.go
internal/sbom/parse_test.go
Place test fixtures in testdata/:
testdata/cyclonedx-before.json
testdata/spdx-sample.json
testdata/syft-sample.json
# Run tests for one package
go test -v ./internal/sbom/
# Run a specific test
go test -v -run TestParseCycloneDX ./internal/sbom/
# Run with coverage
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.outOutput formatting tests use golden file snapshots in testdata/snapshots/. If you intentionally change output formatting:
# Review changes
make snapshot-test
# Update golden files if the new output is correct
make update-snapshot
# Verify
make snapshot-testLook for issues labeled good first issue on GitHub.
- Additional SBOM format support (e.g., CycloneDX XML)
- New policy rules
- Output format improvements
- Performance optimizations for large SBOMs
- Web UI enhancements
- Documentation and examples
- Follow standard Go conventions (
gofmt,go vet) - Keep functions focused and short
- Use table-driven tests where appropriate
- Handle errors explicitly — don't ignore them silently
- Internal packages (
internal/) are not part of the public API
- Open a GitHub Discussion for questions
- Open an Issue for bugs or feature requests
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.