Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Support for casing? #191

Open
dxps opened this issue Jul 25, 2024 · 2 comments
Open

Support for casing? #191

dxps opened this issue Jul 25, 2024 · 2 comments

Comments

@dxps
Copy link

dxps commented Jul 25, 2024

Dear all,

First of all, tried this plugin and it works just fine. Thanks for maintaining it! 🙏

I know it's about formatting, but can this - or do you know about other plugin(s) that - can cover the casing, such as lower camel camel case for method or local variables names, please?

Thanks!

@klaraward
Copy link
Contributor

Hi, the formatting logic itself is in
https://github.com/google/google-java-format which follows
https://google.github.io/styleguide/javaguide.html#s5.3-camel-case.

Easiest is probably if you check there for any functionality you think might be missing.

@dxps
Copy link
Author

dxps commented Jul 25, 2024

@klaraward Thanks, Klara!

Concretely speaking, my wish is to get an warning (or even an error aka generate a failure) when such code exists:

@RestController
public class IndexController {

  @GetMapping("/")
  public String index() {

    var some_greeting = "Welcome";

    if (System.currentTimeMillis() % 2 == 0) {
      some_greeting += "!";
    }

    return some_greeting;
  }
}

I would like to pick up the not-recommeded cases, such as using snake case for local variables.

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

No branches or pull requests

2 participants