spotify-checkstyle-config icon indicating copy to clipboard operation
spotify-checkstyle-config copied to clipboard

Disable CommentsIndentation module

Open dietervdw-spotify opened this issue 7 years ago • 2 comments

Indented comments often don't make much sense if you're commenting out code. Especially for commenting out single lines, IntelliJ places the comment marker on the beginning of the line. It is quite silly to then have to align the comment with the surrounding code (pushing the actual code to the right out of the 'usual' code indentation, unless you invest time in cutting away the whitespace to keep the code aligned).

So much failed compile iterations because of this silly rule.

dietervdw-spotify avatar May 31 '18 13:05 dietervdw-spotify

What is the use-case for committing commented-out code?

dflemstr avatar Jun 12 '18 21:06 dflemstr

@dflemstr It's not necessarily about committed code, when developing and disabling a piece of code this has caused me to lose a compile iteration many times.

  • I know you can disable checkstyle of course, but it's enabled by default (good!) and you only know you need to correct the comments or disable checkstyle after you've been bitten and lose a compilation cycle.
  • Nobody cares about comment indentation when experimenting with code / commenting out stuff / developing -> this rule only causes frustration.
  • It seems a bit patronizing to decide nobody should ever commit commented-out code.
  • Neither the google formatter nor IntelliJ's formatter indent the comments according to checkstyle rules. So you lose always.
  • On top of that the comment indentation rules are awkward and unpredictable. (Try commenting out part of lambda's..)

All things short: it's very hard to avoid losing time by this rule, and it only bites you when indentation is the last thing on your mind (ie. developing).

No problems here if this rule is only applied on Jenkins / Tingle, it's only the default activation when developing that bugs me.

dietervdw-spotify avatar Jun 12 '18 21:06 dietervdw-spotify