Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ remetric scan \
--grafana http://localhost:3000
```

`scan` emits a `findings.Report` (see spec §5.5) - combine with `--output json`
for CI.
`scan` emits a `findings.Report` envelope (target, overview, findings,
warnings) - combine with `--output json` for CI.

## VictoriaMetrics support

Expand Down
4 changes: 2 additions & 2 deletions internal/analyzers/labelpattern/patterns.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ package labelpattern

import "regexp"

// defaultPatternSources are the verbatim regex patterns from the spec
// (§6.3). Compiled lazily via DefaultPatterns.
// defaultPatternSources are the high-cardinality label-name patterns
// the analyzer flags by default. Compiled lazily via DefaultPatterns.
var defaultPatternSources = []string{
`(?i).*(uuid|guid).*`,
`(?i).*_id$`,
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func validateOutput(s string) error {

// renderReport dispatches Report rendering based on cfg.Output.
// Terminal output prints any Warnings as a yellow banner above the
// findings table. JSON emits the full §5.5 envelope.
// findings table. JSON emits the full Report envelope.
//
// renderReport populates Finding.DocURL from Finding.Class for every
// finding in rep that has a Class but no caller-provided DocURL. The fill
Expand Down
4 changes: 2 additions & 2 deletions internal/findings/severity.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ func ParseSeverity(s string) (Severity, error) {
return 0, fmt.Errorf("unknown severity %q", s)
}

// MarshalJSON encodes the severity as a lower-case string,
// matching the JSON schema in the spec (§5.5).
// MarshalJSON encodes the severity as a lower-case string
// (critical|high|medium|low) for the public JSON wire form.
func (s Severity) MarshalJSON() ([]byte, error) {
return json.Marshal(s.lower())
}
Expand Down
3 changes: 2 additions & 1 deletion internal/output/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ func (r *Renderer) RenderFindingsWithIgnored(fs []findings.Finding, ignored int)
return r.encode(envelope)
}

// RenderReport emits the full §5.5 schema.
// RenderReport emits the full Report envelope (target, overview,
// findings, warnings, ignored_count, scanned_at).
func (r *Renderer) RenderReport(rep *findings.Report) error {
if rep == nil {
return fmt.Errorf("output/json: nil report")
Expand Down