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

googleJavaFormat naming conventions not being enforced #743

Closed
MelanieBrett opened this issue Dec 1, 2020 · 1 comment
Closed

googleJavaFormat naming conventions not being enforced #743

MelanieBrett opened this issue Dec 1, 2020 · 1 comment
Labels

Comments

@MelanieBrett
Copy link

I'm trying to implement Spotless but finding that it doesn't detect incorrect naming conventions as per the google style guide eg. naming a variable in camel case or a method in upper-letters.

Does spotless support this feature and should it be enforcing these rules? If not how could I modify it to do so?

@nedtwigg nedtwigg changed the title Naming convention violations googleJavaFormat naming conventions not being enforced Dec 1, 2020
@nedtwigg
Copy link
Member

nedtwigg commented Dec 1, 2020

There is a difference between a formatting error which can be easily fixed locally (e.g. indentation) versus one which requires a widespread refactor which might affect multiple files (e.g. naming conventions). Read this comment for more info.

That said, if you want Spotless to enforce naming conventions, that is possible. You have three paths:

  1. add a feature to https://github.com/google/google-java-format
  2. add a custom step inside a buildscript https://github.com/diffplug/spotless/tree/main/plugin-gradle#custom-steps
  3. create a new step https://github.com/diffplug/spotless/blob/main/CONTRIBUTING.md

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

No branches or pull requests

2 participants