Skip to content

feat: add ods init command and SARIF report output#14

Merged
shenxianpeng merged 2 commits into
mainfrom
feature/ods-init-and-sarif
May 30, 2026
Merged

feat: add ods init command and SARIF report output#14
shenxianpeng merged 2 commits into
mainfrom
feature/ods-init-and-sarif

Conversation

@shenxianpeng
Copy link
Copy Markdown
Contributor

Summary

Adds the two highest-impact CLI improvements: ods init for one-command adoption, and SARIF output for CI tool integration.

Changes

New: ods init github command

One-command scaffolding that eliminates the need to read the spec before adopting:

ods init github

Generates:

  • .github/PULL_REQUEST_TEMPLATE.md — ODS-compliant PR template
  • .github/workflows/ods-l1.yml — PR validation workflow
  • .github/workflows/ods-commit-message.yml — commit validation workflow
  • .ods.yaml — default enterprise policy config

Includes skip-if-exists logic, next-step instructions, and badge guidance.

New: SARIF v2.1.0 output

ods report now generates ods-compliance.sarif alongside HTML, JSON, SVG, and Markdown. SARIF is an OASIS standard supported by GitHub Code Scanning and Azure DevOps. Each result includes rule ID (ODS01/02/03), severity level, and file-level location hints.

Modified

  • README.md — Added stable surface table (init/validate/report as production), dogfooding badge, prominent experimental warning
  • report.go — Added SARIF() generator with full SARIF v2.1.0 schema
  • report_test.go — Updated to verify SARIF file

Testing

  • go build ./...
  • go test ./... ✅ (all packages pass)
  • Manual: ods init github generates correct files in empty dir
  • Manual: ods report produces valid ods-compliance.sarif with pass and fail scenarios

ODS Bot added 2 commits May 30, 2026 21:01
- New 'ods init github' command: scaffolds PR template, CI workflows, .ods.yaml
- New SARIF v2.1.0 output in ods report (ods-compliance.sarif)
- Updated README: stable surface table, dogfooding badge, experimental warning
- Updated report test to verify SARIF file generation
Use github.com/open-delivery-spec/spec for badge links,
open-delivery-spec.github.io/spec for docs, adoption guide, and SARIF URIs.
@shenxianpeng shenxianpeng merged commit f511c8e into main May 30, 2026
4 checks passed
@shenxianpeng shenxianpeng deleted the feature/ods-init-and-sarif branch May 30, 2026 18:14
@shenxianpeng shenxianpeng added the enhancement New feature or request label May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant