Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Disable CommentsIndentation module #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dietervdw-spotify
Copy link

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.

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.
@dflemstr
Copy link
Contributor

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

@dietervdw-spotify
Copy link
Author

@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.

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

Successfully merging this pull request may close these issues.

2 participants