Skip to content

Conversation

@macfarla
Copy link
Contributor

@macfarla macfarla commented Dec 8, 2025

PR description

Introduce consistency of PicoCLI annotations. Inspired by this PR attempting to make sense of booleans in the besu docs: hyperledger/besu-docs#1890

PicoCLI default arity info https://picocli.info/#_default_arity
for booleans, default arity is 0..1
for everything else, default arity is 1 - so you only need to specify arity if it is != 1

So this PR

  • removes arity = 1 from non-boolean options
  • removes arity = 1 from boolean options and ensures they have a semantically sensible fallback value
    • I started doing this but it would be a breaking change, since it would no longer allow for example --p2p-enabled true but instead would require --p2p-enabled=true so reverted those changes.

Note this PR does not address all instances of this, but if there is agreement on this approach we can roll it out across all options classes.

Fixed Issue(s)

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • spotless: ./gradlew spotlessApply
  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests
  • hive tests: Engine or other RPCs modified?

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Copilot AI review requested due to automatic review settings December 8, 2025 07:14
@github-project-automation github-project-automation bot moved this to Open PRs in RC 25.12.0 Dec 8, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

@fab-10 fab-10 left a comment

Choose a reason for hiding this comment

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

LGTM, a nice addition is to have a error prone check to enforce this.

I agree with keeping the 0..1 for boolean, because otherwise it will break too many existing deployment.

@macfarla macfarla enabled auto-merge (squash) December 15, 2025 02:46
@macfarla macfarla merged commit 0399228 into hyperledger:main Dec 15, 2025
46 checks passed
@github-project-automation github-project-automation bot moved this from Open PRs to Done in RC 25.12.0 Dec 15, 2025
@macfarla macfarla deleted the arity-cleanup branch December 15, 2025 05:07
@macfarla macfarla mentioned this pull request Dec 15, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants