Skip to content

Name --replace in the error for --dry-run with in-place formatting - #48

Merged
abashev merged 1 commit into
mainfrom
dry-run-replace-message
Sep 23, 2026
Merged

abashev merged 1 commit into
mainfrom
dry-run-replace-message

Conversation

@abashev

@abashev abashev commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #40, split out of #45. Upstream report: google/google-java-format#1094.

From upstream, with the author kept

google/google-java-format#1451 by rootkiller6788 (open upstream), commit authored by them. The error for --dry-run with in-place formatting said "cannot use --dry-run and --in-place at the same time", but there is no --in-place flag: the flag is -i, -r, -replace or --replace. The message now names --replace, the long form the usage text shows.

Checked

  • CommandLineFlagsTest.inPlaceDryRun checks both --replace --dry-run and -i -n, and fails on the old message.
  • ./gradlew :open-java-format:test on JDK 21: 1447 tests, all green.

"cannot use --dry-run and --in-place at the same time" named a flag
that does not exist: in-place formatting is -i, -r, -replace or
--replace (#40, from google/google-java-format#1094). The message now
says --replace, the long form the usage text shows.

This ports google/google-java-format#1451 by rootkiller6788, including
its test for the --replace --dry-run spelling next to -i -n.
@abashev
abashev force-pushed the dry-run-replace-message branch from 3a32861 to c73a083 Compare September 23, 2026 08:53
@abashev
abashev disabled auto-merge September 23, 2026 10:30
@abashev
abashev merged commit c5f3de1 into main Sep 23, 2026
10 checks passed
@abashev
abashev deleted the dry-run-replace-message branch September 23, 2026 10:31
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