Skip to content

docs: document -Ppre-commit as auto-fixing, not a pass/fail check - #137

Merged
cuioss-oliver merged 6 commits into
mainfrom
chore/document-pre-commit-as-auto-fixing
Sep 9, 2026
Merged

cuioss-oliver merged 6 commits into
mainfrom
chore/document-pre-commit-as-auto-fixing

Conversation

@cuioss-oliver

Copy link
Copy Markdown
Collaborator

Aligns this repo's -Ppre-commit framing to what the command actually does.

-Ppre-commit is a formatter, not a pass/fail check. The profile inherited from cui-java-parent binds two mutating executions ahead of verify:

  • license:format (process-sources) — adds or updates license headers
  • rewrite:run (no declared phase → descriptor default process-test-classes) — applies the OpenRewrite recipes

Both run before verify, so a run that repaired the tree and a run that changed nothing both exit 0. Documenting it as a "check", "gate", or "quality verification" implies a green run means the tree was already clean — it does not. Empirically: strip a license header, run -Ppre-commit verify, and it exits 0 with the header silently restored and git status clean.

The corpus carried two contradictory framings. This aligns everything to: -Ppre-commit auto-fixes; review what it changed and commit it.

The reference wording is cuioss-parent-pom's own docs, which already say it correctly ("Adds or updates Apache 2.0 license headers…", "Applies all configured OpenRewrite recipes…") and are unchanged.

Note this is a documentation change only — no build behaviour changes. Auto-fixing is the intended org-wide norm, in every language.

🤖 Generated with Claude Code

cuioss-oliver and others added 2 commits September 9, 2026 09:34
-Ppre-commit rewrites tracked sources in place (license:format,
rewrite:run). Documenting it as a pass/fail 'check' or 'gate' misleads:
a run that repaired the tree and a run that changed nothing both exit 0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
-Ppre-commit rewrites tracked sources in place (license:format,
rewrite:run). Documenting it as a pass/fail 'check' or 'gate' misleads:
a run that repaired the tree and a run that changed nothing both exit 0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cuioss-oliver cuioss-oliver added the skip-bot-review Skip automated bot code review (Gemini/CodeRabbit/Sourcery) label Sep 9, 2026
@coderabbitai

coderabbitai Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Excluded labels (none allowed) (1)
  • skip-bot-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: cuioss/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 1586507e-e60e-479d-9959-461807d353ce

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Sep 9, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="CLAUDE.md" line_range="20" />
<code_context>
 ./mvnw test -Dtest=ClassName#methodName

-# Pre-commit checks
+# Pre-commit auto-fix (license headers + formatting) - review and commit what it changed
 ./mvnw -Ppre-commit clean verify -DskipTests
 ```
</code_context>
<issue_to_address>
**nitpick:** The new descriptions reduce the profile's mutations to “license headers + formatting,” but `rewrite:run` applies all configured OpenRewrite recipes, which can make non-formatting source changes. Users following this wording can review the profile as a formatter only and overlook semantic recipe changes.

**Triggers:** When a configured OpenRewrite recipe performs a transformation that is not merely formatting.

**Suggested fix:** Describe the profile as applying license formatting and all configured OpenRewrite recipes, and require reviewing every resulting diff.

```suggestion
# Pre-commit auto-fix (license formatting + all configured OpenRewrite recipes) - review every resulting diff before committing
```
</issue_to_address>

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread CLAUDE.md Outdated
cuioss-oliver and others added 2 commits September 9, 2026 09:47
Review feedback: 'license headers + formatting' understates the profile.
license:format (mycila) updates headers; rewrite:run applies EVERY configured
OpenRewrite recipe, which includes modernization and can make semantic source
changes -- not merely formatting. Attributing both to 'OpenRewrite formatting'
invites reviewing the diff as cosmetic.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review feedback: 'license headers + formatting' understates the profile.
license:format (mycila) updates headers; rewrite:run applies EVERY configured
OpenRewrite recipe, which includes modernization and can make semantic source
changes -- not merely formatting. Attributing both to 'OpenRewrite formatting'
invites reviewing the diff as cosmetic.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
cuioss-oliver and others added 2 commits September 9, 2026 09:47
Review feedback: 'license headers + formatting' understates the profile.
license:format (mycila) updates headers; rewrite:run applies EVERY configured
OpenRewrite recipe, which includes modernization and can make semantic source
changes -- not merely formatting. Attributing both to 'OpenRewrite formatting'
invites reviewing the diff as cosmetic.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review feedback: 'license headers + formatting' understates the profile.
license:format (mycila) updates headers; rewrite:run applies EVERY configured
OpenRewrite recipe, which includes modernization and can make semantic source
changes -- not merely formatting. Attributing both to 'OpenRewrite formatting'
invites reviewing the diff as cosmetic.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sourcery assessment

Approved.

sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Sep 9, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sourcery assessment

Approved.

@sourcery-ai
sourcery-ai Bot dismissed their stale review September 9, 2026 07:48

Sourcery withdrew this approval because the latest commits introduced blocking findings.

@cuioss-oliver
cuioss-oliver merged commit de9834a into main Sep 9, 2026
19 checks passed
@cuioss-oliver
cuioss-oliver deleted the chore/document-pre-commit-as-auto-fixing branch September 9, 2026 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-bot-review Skip automated bot code review (Gemini/CodeRabbit/Sourcery)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant