feat(check): add --max-warnings flag to fail on warnings#374
Merged
Conversation
Adds an ESLint/oxlint-style `--max-warnings <n>` option to `archgate check`. When the total warning count exceeds the threshold, the check fails with exit 1. `--max-warnings 0` fails on any warning. Without the flag, warnings continue to have no effect on the exit code. The summary now carries a `warningsExceeded` field which folds into `pass`, so console/JSON/CI status and telemetry stay consistent. Docs (EN + pt-br) and tests updated. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Deploying archgate-cli with
|
| Latest commit: |
602da0b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3b9eb6a4.archgate-cli.pages.dev |
| Branch Preview URL: | https://claude-hardcore-lichterman-8.archgate-cli.pages.dev |
…erman-88dcb2 # Conflicts: # tests/helpers/telemetry.test.ts
Resolves merge with main: adopt main's expect().not.toThrow() telemetry test style (merging the two trackCheckResult cases to stay under the 500-line lint cap) and add the --max-warnings docs to the new nb locale mirror so GEN-002 i18n-translation-drift passes. Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
…2' into claude/hardcore-lichterman-88dcb2
Contributor
Code Coverage
Full HTML report available in workflow artifacts. Per-directory breakdown
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds an ESLint/oxlint-style
--max-warnings <n>flag toarchgate check, so warnings can be promoted to failures — the same capability every major linter offers.--max-warnings <n>makesarchgate checkexit1when the total warning count exceedsn.--max-warnings 0fails on any warning.severity: "warning") never affect the exit code.warningsExceededfield that folds intopass, keeping console /--json/--cistatus and telemetry consistent. The console reporter prints a note explaining a warning-triggered failure.NaN, negative) are rejected with a clear error and exit1.Implementation notes
new Option().argParser()+.addOption()per ARCH-008 (typed command options).buildSummary(result, { maxWarnings })computeswarningsExceeded;getExitCodereturns1when it is set (rule-execution errors still take precedence with exit2).EMPTY_SUMMARYand the telemetrytrackCheckResultsignature (used_max_warnings) updated accordingly.Test plan
bun run lint/typecheck/format:checkbun test— added unit tests (tests/engine/reporter.test.ts) and integration tests (tests/integration/check-max-warnings.test.ts) covering: warnings ignored without the flag, exit 1 at--max-warnings 0, tolerance up to threshold, rule-error precedence, and invalid-value rejectionarchgate checkpasses (31/31 rules)bun run knipfails on pre-existing tooling-binary noise (oxlint/oxfmt/knip/czg/conventional-changelog) — unrelated to this change; reproduces on a clean tree🤖 Generated with Claude Code