3

I have just installed checkstyle in eclipse. It works by bringing up the appropriate errors in the part of the screen where you place break points. However, I was just wondering whether it actually will format the code for you and indeed add the empty comments etc for you to fill in?

If it does, how do you get it to do it. Thanks

Biscuit128
  • 5,218
  • 22
  • 89
  • 149

2 Answers2

5

No, checkstyle doesn't format code, it only identifies violations of different types. You can configure Jalopy to format as per your checkstyle configuration.

Vikdor
  • 23,934
  • 10
  • 61
  • 84
  • Jalopy doesn't look to be well supported anymore. I'm not sure about Eclipse, but it looks like IntelliJ will format code based on checkstyle configs if you import it as the code style. https://stackoverflow.com/a/35273850/687245 – louis1204 Oct 13 '22 at 20:38
1

Checkstyle is a static code analysis tool. It doesn't do formating.

However Eclipse has a preinstalled Java Code Formatter. Have a look here for details: http://www.ralfebert.de/blog/eclipseide/source_formatting/

jstadler
  • 340
  • 1
  • 3
  • 7