Skip to content

Add scan configuration: enable/disable categories, metrics, components - #1

Merged
Nayjest merged 1 commit into
mainfrom
feature/scan-configuration
Jul 6, 2026
Merged

Add scan configuration: enable/disable categories, metrics, components#1
Nayjest merged 1 commit into
mainfrom
feature/scan-configuration

Conversation

@Nayjest

@Nayjest Nayjest commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a ScanConfig that lets a scan switch off any part of the scoring methodology — a single component, a whole metric, or a whole category — and embeds it in every report (config field, schema 0.7.0) so scores stay reproducible and auditable.
  • Disabling something is handled exactly like missing data: the item is excluded from scoring and the remaining weights are renormalized, never counted as zero. Metric/overall notes distinguish "no data" from "disabled in scan configuration".
  • CLI: --config <file.json>, --disable-category, --disable-metric, --disable-component METRIC:COMPONENT (flags merge on top of a config file). Unknown keys produce warnings (validate_config) instead of failing. Re-rendering a stored JSON report keeps its own embedded config and warns that config flags are ignored.
  • HTML reports (both repository and org templates) render a new "Scan configuration" section — "Full methodology" when nothing is disabled, otherwise chips listing disabled categories/metrics/components.
  • Docs updated: docs/metrics.md (new Configuration section), docs/report-schema.md (schema version bump + config field), README.md (usage examples).

Why

Metrics/categories/components previously had no way to be selectively enabled/disabled per scan — this was needed to support running audits with a customized methodology (e.g. a certification profile that skips certain checks) while keeping the resulting score transparent about what was and wasn't measured.

Test plan

  • pytest — 112 passed (95 pre-existing + 17 new in tests/test_config.py)
  • Manual smoke test: disabling the security category and popularity metric renormalizes correctly and lifts the overall score as expected; JSON round-trips config; CLI --disable-component builds config from METRIC:COMPONENT flags; re-rendering a stored JSON with stray --disable-* flags emits the ignore-note and keeps the original config
  • Rendered a sample HTML report with a customized config and visually confirmed the "Scan configuration" section and per-metric "disabled in scan configuration" notes

🤖 Generated with Claude Code

…nents

Lets a scan switch off any part of the methodology (component, metric,
or category) via a ScanConfig embedded in every report, so scores stay
reproducible and auditable. Disabled items are excluded from scoring
exactly like missing data, with remaining weights renormalized. CLI
gains --config/--disable-category/--disable-metric/--disable-component;
HTML reports render a "Scan configuration" section.
@Nayjest
Nayjest merged commit b78a7b4 into main Jul 6, 2026
1 check passed
@Nayjest
Nayjest deleted the feature/scan-configuration branch July 6, 2026 20:13
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.

1 participant