Skip to content

feat: --no-fail-public — report unused public declarations without failing the build - #23

Merged
PiotrRogulski merged 5 commits into
mainfrom
feat/no-fail-public
Aug 5, 2026
Merged

feat: --no-fail-public — report unused public declarations without failing the build#23
PiotrRogulski merged 5 commits into
mainfrom
feat/no-fail-public

Conversation

@claude

@claude claude Bot commented Jul 24, 2026

Copy link
Copy Markdown

Requested by Łukasz Komoszyński · Slack thread

Before

--set-exit-if-changed fails on any unused declaration. --no-public hides public findings entirely — so you could report public API or gate CI on private, never both.

After

--no-fail-public keeps public findings in the report but drops them from the exit code: CI surfaces unused public API as advisory while failing only on unused private declarations. Default unchanged (--fail-public on).

ciach . --set-exit-if-changed --no-fail-public   # report public, gate on private

Why

For leancode_flutter_template CI, where the workspace keeps intentional-but-unused public API for downstream apps — one run both reports everything and gates on private only.

How

  • New failPublic CiachOption enum entry (FlagOption, argName fail-public, configKey /fail-public, default true), so it's also settable from ciach.yaml.
  • Resolved via ResolvedOptions.failPublic; bin/ciach.dart drops public findings (isPrivate) from the exit-code subset when off. Report path unchanged.
  • CLI exit-code test (test/cli_exit_code_test.dart) driving the real binary against the fixture.

claude Bot pushed a commit that referenced this pull request Jul 24, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012RMbmsRmDqx5eWXFa8R82V
claude added 2 commits August 5, 2026 10:24
--no-fail-public keeps unused public declarations in the report but
excludes them from the exit code under --set-exit-if-changed, so CI can
surface unused public API as advisory while still failing only on unused
private declarations. The default (--fail-public) is unchanged.

Defined as a CiachOption enum entry so it is settable from ciach.yaml too,
matching how every other option is now declared.
@claude
claude Bot force-pushed the feat/no-fail-public branch from 13da502 to c372679 Compare August 5, 2026 10:24
Comment thread README.md Outdated
It duplicated the options table and the GitHub Actions section, and its
longer command broke the aligned comment column in the usage block.
@PiotrRogulski
PiotrRogulski marked this pull request as ready for review August 5, 2026 10:52
@PiotrRogulski
PiotrRogulski requested a review from Komoszek as a code owner August 5, 2026 10:52
@PiotrRogulski
PiotrRogulski merged commit a300130 into main Aug 5, 2026
3 checks passed
@PiotrRogulski
PiotrRogulski deleted the feat/no-fail-public branch August 5, 2026 11:09
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