Skip to content

feat: add --fail-on option to control failing severity#77

Merged
Tim-Pohlmann merged 3 commits into
mainfrom
worktree-bridge-cse_01UgA3e2TpYyekP5HesHUJfE
Jun 26, 2026
Merged

feat: add --fail-on option to control failing severity#77
Tim-Pohlmann merged 3 commits into
mainfrom
worktree-bridge-cse_01UgA3e2TpYyekP5HesHUJfE

Conversation

@Tim-Pohlmann

Copy link
Copy Markdown
Owner

Summary

Adds a --fail-on option to dolphin check that configures the lowest finding severity that causes a non-zero exit code.

  • --fail-on error (default) — fail only on ERROR findings (unchanged behavior)
  • --fail-on warning — fail on ERROR or WARNING
  • --fail-on info — fail on any finding

Validated via FromAmong, default error. Exit logic compares each finding against the threshold using the Severity enum ordering.

Tests

Added tests confirming a WARNING finding returns 0 by default and 1 with --fail-on warning.

🤖 Generated with Claude Code

Adds a --fail-on option to `dolphin check` that configures the lowest
severity (error, warning, info) that causes a non-zero exit. Defaults to
error, preserving existing behavior.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a --fail-on option to dolphin check to control the lowest finding severity that produces a non-zero exit code, enabling stricter CI behavior when desired while keeping the default behavior unchanged.

Changes:

  • Introduced --fail-on {error|warning|info} option (default: error) to configure failure threshold.
  • Updated CheckCommand.HandleAsync to compute the exit code based on findings’ severities vs the configured threshold.
  • Added unit tests validating default behavior for WARNING findings and behavior when --fail-on warning is provided.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Dolphin/Cli/CheckCommand.cs Adds --fail-on option wiring and updates exit-code logic to use a severity threshold.
tests/Dolphin.Tests/CheckCommandTests.cs Adds tests for WARNING findings under default threshold and --fail-on warning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Dolphin/Cli/CheckCommand.cs Outdated
Comment thread tests/Dolphin.Tests/CheckCommandTests.cs
Address review feedback: compute the failing severities explicitly rather
than relying on the Severity enum's ordinal ordering, and normalize the
--fail-on input case-insensitively for direct callers. Add coverage for the
info threshold and the option wiring.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread tests/Dolphin.Tests/CheckCommandTests.cs
Comment thread src/Dolphin/Cli/CheckCommand.cs Outdated
Comment thread src/Dolphin/Cli/CheckCommand.cs Outdated
Address review feedback: lower-case the --fail-on value a single time in
HandleAsync instead of per-finding inside Fails(), and remove the unused
System.CommandLine.Parsing import from the tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread tests/Dolphin.Tests/CheckCommandTests.cs
Comment thread tests/Dolphin.Tests/CheckCommandTests.cs
Comment thread tests/Dolphin.Tests/CheckCommandTests.cs
@Tim-Pohlmann Tim-Pohlmann merged commit c74a788 into main Jun 26, 2026
8 checks passed
@Tim-Pohlmann Tim-Pohlmann deleted the worktree-bridge-cse_01UgA3e2TpYyekP5HesHUJfE branch June 26, 2026 18:53
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.

2 participants