✨ CLI flag to skip unsupported repo checks #4921
Open
+345
−41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Introduces a new
--skip-unsupported-checksCLI flag to skip checks that are not supported by a repo type (e.g. when running against a GitLab repo, it will skip checks that don't have GitLab support, not including them in the final report and score).For a bit of context, we run Scorecard in an air-gapped environment to score private repositories hosted on a self-hosted GitLab CE instance. Since most of the checks are not supported by GitLab, the score will never be 10/10, being a bit deceptive to our developers in that they cannot do anything to fix that. This change allows the scores to be more representative of what developers can actually achieve for their repository.
What is the current behavior?
When running Scorecard against non-GitHub repositories (e.g., GitLab, Azure DevOps, local), all checks are executed regardless of whether they support the repository type. This results in misleading scores where checks that are incompatible with the repo type fail, producing gaps in the score that developers cannot fix or address since their repository hosting platform doesn't support those checks.
What is the new behavior (if this is a feature change)?**
With the new
--skip-unsupported-checksflag, Scorecard will:checks.yamlWhen the flag is enabled with the default format, skipped checks are printed to stderr for visibility:
Skipping (<repo-uri>) [<check-name>]Which issue(s) this PR fixes
Fixes #4795
Special notes for your reviewer
When using this flag, the number of checks run may be significantly lower than the full suite, particularly for non-GitHub repositories. For GitLab, most checks already have experimental support but are not listed as supported in
checks.yaml. This can probably be addressed in a follow-up PR (related issue #4700).Does this PR introduce a user-facing change?
For user-facing changes, please add a concise, human-readable release note to
the
release-note(In particular, describe what changes users might need to make in their
application as a result of this pull request.)