Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

IntelliJ checkstyle plugin dropped support for checkstyle 8.x, upgrade checkstyle to newer version #22286

Closed
1 of 2 tasks
lhotari opened this issue Mar 16, 2024 · 4 comments · Fixed by #22291
Closed
1 of 2 tasks

Comments

@lhotari
Copy link
Member

lhotari commented Mar 16, 2024

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

IntelliJ checkstyle plugin dropped support for checkstyle 8.x in the 5.88.0 version update.

Fails with this error message:

The Checkstyle rules file could not be parsed. cannot initialize module TreeWalker - cannot initialize module JavadocMethod - Property 'scope' does not exist, please check the documentation The file has been blocked for 60s

Solution

  • Upgrade buildtools/src/main/resources/pulsar/checkstyle.xml to support newer checkstyle 10.x version
  • Upgrade checkstyle to 10.x

Alternatives

No response

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@nodece
Copy link
Member

nodece commented Mar 18, 2024

What do you think about https://github.com/diffplug/spotless?

This plugin supports check and format code, I think we can use spotless instead of checkstyle.

Once we notice that the code has been formatted by spotless on the master branch, we will be limited when doing cherry-pick operations. If we can double-check by spotless and checkstyle, this will be simpler.

We have this discussion thread on the dev@pulsar.apache.org, but I don't know this URL, which title is [DISCUSS] Consistent code style (esp. ws/indent) and autotools

@lhotari
Copy link
Member Author

lhotari commented Mar 18, 2024

What do you think about https://github.com/diffplug/spotless?

This plugin supports check and format code, I think we can use spotless instead of checkstyle.

Once we notice that the code has been formatted by spotless on the master branch, we will be limited when doing cherry-pick operations. If we can double-check by spotless and checkstyle, this will be simpler.

We have this discussion thread on the dev@pulsar.apache.org, but I don't know this URL, which title is [DISCUSS] Consistent code style (esp. ws/indent) and autotools

@nodece What you are proposing is a completely different thing. I don't think that we want to change the way how code is formatted in Pulsar right now. Such changes cause unnecessary code changes without valuable benefits.

We should simply upgrade checkstyle to a supported version right now. That requires migrating the configuration file slightly.

@nodece
Copy link
Member

nodece commented Mar 18, 2024

Upgrading the checkstyle is simpler, I agree with you. PR: #22291

Right now, the checkstyle is not strict, some places have extra indentation, while others have extra spaces, so I suggest using spotless.

@lhotari
Copy link
Member Author

lhotari commented Mar 18, 2024

Upgrading the checkstyle is simpler, I agree with you. PR: #22291

Right now, the checkstyle is not strict, some places have extra indentation, while others have extra spaces, so I suggest using spotless.

Making a change to formatting is a broad change that cause more harm than benefit to the Pulsar project currently. We can reconsider after the maintenance strategy has been revisited.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants