Skip to content

fix: make RequireIssuesResolved independent of ShowIssues - #84

Open
ehennestad wants to merge 2 commits into
mainfrom
fix-require-issues-resolved-without-show-issues
Open

ehennestad wants to merge 2 commits into
mainfrom
fix-require-issues-resolved-without-show-issues

Conversation

@ehennestad

Copy link
Copy Markdown
Owner

matbox.tasks.codecheckToolbox displays the issues table, throws MatBox:CodeIssues:UnresolvedIssues and clears the unused issues output in one block. That block runs only when ShowIssues is true, and ShowIssues defaults to false.

Problem

  • RequireIssuesResolved=true without ShowIssues=true never throws, whatever SeverityThreshold is. The README example for failing on warnings uses exactly that call.
  • With ShowIssues=false, a call without an output and without a semicolon displays the codeIssues object as ans, including the issues table.

Fix

The display, the throw and the clear are three separate steps:

  • The issues table is displayed when there are issues and ShowIssues is true.
  • RequireIssuesResolved is evaluated against SeverityThreshold regardless of ShowIssues. The threshold logic is unchanged.
  • issues is cleared whenever the function is called without an output.

Behaviour change

A caller that passes RequireIssuesResolved=true without ShowIssues and has issues at or above the threshold passes today and fails after this change.

Tests

TasksTest gets five tests that run the check on a temporary folder holding one file with one warning: the throw with RequireIssuesResolved alone, the throw together with ShowIssues, no throw when the only issue is below SeverityThreshold, no throw with default options, and no issues displayed for a call without an output or a semicolon.

🤖 Generated with Claude Code

codecheckToolbox threw MatBox:CodeIssues:UnresolvedIssues only when
ShowIssues was also true. The throw sat inside the block that displays
the issues table, and that block is skipped when ShowIssues is false,
which is the default. A call with RequireIssuesResolved=true alone
therefore never failed, including the example in the README.

The same block held the "clear issues" for calls without an output, so
with ShowIssues=false a call without a semicolon displayed the issues
as ans.

The display, the throw and the clear are now three separate steps.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

116 tests   115 ✅  32s ⏱️
  7 suites    1 💤
  1 files      0 ❌

Results for commit 0a896a7.

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