apigee / apigee/devrel

Java linter defaults to sun style checks

Open
#636 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
221
Forks
174
PR merge metrics
No merged PRs in 30d

Description

This ruleset is highly restrictive and insists on 80 columns line limit, which is counter-productive.

- Using [checkstyle v9.0.1] https://checkstyle.sourceforge.io
9113- Mega-Linter key: [JAVA_CHECKSTYLE]
9114- Rules config: [sun_checks.xml]

we need to switch to the google style set.

as a further incremental improvement, we can configure a google rule set from a google repository.

https://github.com/googleapis/google-api-java-client/blob/main/checkstyle.xml

We also would need to discuss and finetune specific rules.
Two I've encountered with not helpful defaults:

Error: /github/workspace/references/hashicorp-vault-integration/vault-facade-callout/src/main/java/com/exco/vaultkeystojwks/VaultKeysToJwks.java:77:3: Comment matches to-do format 'TODO:'. [TodoComment]

https://checkstyle.sourceforge.io/apidocs/com/puppycrawl/tools/checkstyle/checks/coding/HiddenFieldCheck.html

we are going to hit more in the future, thus it is better to be ready for it and have a process in place.

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.

Research direction

Start by locating the repository configuration for the JAVA_CHECKSTYLE Mega-Linter key and inspect its current sun_checks.xml reference. Compare it with the linked Google API Client checkstyle.xml and review the reported TodoComment and HiddenFieldCheck issues; done should include an agreed Google-based ruleset and a defined process for tuning exceptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.