Skip to content

refine(cli): rename --exit-zero; fix status_code in cmd_all#187

Merged
Borda merged 4 commits into
mainfrom
cli/exit-zero
May 29, 2026
Merged

refine(cli): rename --exit-zero; fix status_code in cmd_all#187
Borda merged 4 commits into
mainfrom
cli/exit-zero

Conversation

@Borda

@Borda Borda commented May 29, 2026

Copy link
Copy Markdown
Owner
Before submitting
  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

  • Rename skip_errorsexit_zero across all four CLI subcommands (check, expiry, chains, all) — --exit-zero is the established linter convention (ruff, pylint) and self-describes the semantics; old name read as "swallow Python exceptions"
  • Fix latent bug in cmd_all: remove status_code from has_errors OR — cmd_status is documented as always returning 0 and is not a pass/fail gate; including it was dead code today but fragile
  • Add comment explaining why sub-commands in cmd_all are called with exit_zero=False hard-coded (truthful exit codes needed for aggregate; flag applied once at aggregate level)
  • Update test method names and call sites accordingly
  • Update docs (cli.md, audit.md, README.md) to reference --exit-zero

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

…n cmd_all

- Rename `skip_errors` → `exit_zero` across all four CLI subcommands (check, expiry, chains, all) — `--exit-zero` is the established linter convention (ruff, pylint) and self-describes the semantics; old name read as "swallow Python exceptions"
- Fix latent bug in cmd_all: remove `status_code` from `has_errors` OR — cmd_status is documented as always returning 0 and is not a pass/fail gate; including it was dead code today but fragile
- Add comment explaining why sub-commands in cmd_all are called with exit_zero=False hard-coded (truthful exit codes needed for aggregate; flag applied once at aggregate level)
- Update test method names and call sites accordingly
- Update docs (cli.md, audit.md, README.md) to reference --exit-zero

---
Co-authored-by: Claude Code <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 29, 2026 08:11
@dosubot dosubot Bot added the enhancement New feature or request label May 29, 2026

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

This PR refines the pydeprecate CLI by renaming the “always succeed” flag from skip_errors to exit_zero (documented as --exit-zero) across subcommands, and fixes cmd_all to avoid treating cmd_status as a pass/fail gate when computing aggregate exit status.

Changes:

  • Rename skip_errorsexit_zero in cmd_check, cmd_expiry, cmd_chains, and cmd_all, and update unit tests accordingly.
  • Fix cmd_all aggregate error detection to exclude cmd_status from determining failure.
  • Update docs/README to reference --exit-zero and clarify cmd_all subcommand invocation behavior.

Reviewed changes

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

Show a summary per file
File Description
src/deprecate/_cli.py Renames the CLI flag parameter and fixes cmd_all aggregate exit-code logic.
tests/unittests/test_cli.py Updates unit tests to use exit_zero instead of skip_errors.
README.md Updates CLI docs to reference --exit-zero (needs a small correction re: status support).
docs/guide/cli.md Updates CLI reference table/wording to --exit-zero (needs correction re: packaging missing exit behavior for expiry).
docs/guide/audit.md Updates audit guide examples to use --exit-zero.

Comment thread README.md Outdated
Comment thread docs/guide/cli.md Outdated
Comment thread src/deprecate/_cli.py
Comment thread README.md
@kilo-code-bot

kilo-code-bot Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
docs/guide/cli.md 119 Documentation incorrectly states expiry exits 1 when packaging not installed. Per cmd_expiry in _cli.py (lines 444-446), it returns 0 with a warning when packaging is unavailable.
Files Reviewed (5 files)
  • README.md
  • docs/guide/audit.md
  • docs/guide/cli.md
  • src/deprecate/_cli.py
  • tests/unittests/test_cli.py

The previous SUGGESTION issue has been addressed. The documentation now correctly states that --exit-zero is available for check, expiry, chains, and all subcommands (not "all subcommands" since status doesn't have this flag).


Reviewed by laguna-m.1-20260312:free · 775,256 tokens

Borda and others added 2 commits May 29, 2026 10:25
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- CHANGELOG [Unreleased] ### Changed: document --skip_errors → --exit-zero rename as breaking change (#187)
- docs/guide/cli.md:119 exit-codes table: fix expiry row — packaging-missing now exits 0, not 1; update exit-1 description to 'Expired wrappers found (and --exit-zero not set)'
- docs/guide/cli.md:66 expiry tab block: indent prose line 4 spaces so MkDocs Material renders it inside the tab panel (flush-left line broke tab block)
- tests/integration/test_cli.py: add subprocess tests confirming both --exit-zero (dash) and --exit_zero (underscore) Fire spellings parse correctly and force exit 0 on a package with invalid args_mapping

---
Co-authored-by: Claude Code <noreply@anthropic.com>
@Borda Borda merged commit c2fb163 into main May 29, 2026
50 checks passed
@Borda Borda deleted the cli/exit-zero branch May 29, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants