Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Misleading message for --dry-run with --replace

Open Beginner friendly
#1,094 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
cli

Research direction

Start in CommandLineOptionsParser.java around line 68 and reproduce the message when --dry-run (or -n) is combined with --replace, -replace, -r, or -i. Review the related help text and determine whether the user-facing option name or the reported incompatibility should be corrected. Done means the command no longer refers to an unavailable --in-place option, with help text consistent with the supported flags.

Written by the indexing model from the issue text.

Description

If you specify both --dry-run (or -n) and --replace (or -replace, -r or -i) you get a message stating "cannot use --dry-run and --in-place at the same time".

The problem is that there is no --in-place option. inPlace is however the internal variable name used for --replace. There's two possible fixes:

  1. Change the message. This could affect anything which tries to use the message in some kind of script.
  2. Add the --in-place option at line 68 in CommandLineOptionsParser.java and related help text. This should not affect anything else.
Dominant language
Java
Stars
6.2k
Forks
936
Avg merge
6m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/google-java-format

All issues in google/google-java-format

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.