In every language I have ever used there should be an indent on those statements that are highlighted. In our groovy editor, those statements are flush with the case expression. What are the chances we could get that indent there? Online in groovy tutorials there seems to always be an indent. I feel like this is a deficiency in the auto-formatter or a setting that could be changed.
Since indentation isn't required for the code to work correctly, this is all a matter of preference. You could have everything flush left and it would still work. The IDE editor for ST doesn't auto-indent at all.
That said, why would the IF be indented in this case? The line below the IF, yes, but the if is on the same level as the line above it. It isn't a layer lower. Why would that be indented?
I agree, @srwhite. It's not a huge thing to fix it by hand but one of my frustrations with the general code base for Hubitat and SmartThings is the inconsistency in formatting. If you hold shift and hit tab on a highlighted block of code it auto-formats. I can't use it in half of my apps/drivers because it breaks the manual formatting of switch statements. Because of this I typically format in IntelliJ before committing. It would just be a quality of life improvement.
If you have ever worked with a large code base with many programmers I think you would have a different opinion. Formatting is not a preference at that point. It is often enforced by the repository through various ways. Differences in white space and code formatting can cause conflicts making merges and branching difficult. White space and formatting should always be consistent. Period. Not preferential. If we want to be a bunch of amateurs here that's fine but I'd rather not.
Also, I never said just the IF should be intended by itself. If you noticed my highlighted code does not just contain the IF. The entire block of code under the case statement is not indented. 634 to 636 should have been indented by the editor but instead it justified it to the same indentation as the case expression.
Obviously indents aren't required but almost every code has either an official or formally adopted formatting scheme. I assumed Groovy would follow Java's and therefore use indents there. I think I misunderstood the reason you were removing them.
There is literally no work involved in auto-formatting though. Minifying there would be but there would be no benefit to that unless you were trying to prevent downstream manipulation.
Also, I doubt there is a minifier for groovy specifically (because it serves no real purpose since it's not a web language) but there might be a obfuscator. There certainly are for Java.
Python is consuming the world whether we like it or not. That's one of the things (enforced white space formatting) I didn't like about it at first but after working with programmers that just wouldn't conform to standards I loved it.
The other thing I love are subversion and git hooks. You can enforce formatting convention on any language.