AEM-Rules-for-SonarQube icon indicating copy to clipboard operation
AEM-Rules-for-SonarQube copied to clipboard

[HTL-1] Place HTL attributes before instead of after other attributes?

Open lukasbeck opened this issue 3 years ago • 1 comments

In the HTL Style Guide by Netcentric there was quite a lengthy discussion about whether HTL attributes should be placed before or after other attributes: https://github.com/Netcentric/aem-htl-style-guide/issues/25

They concluded that they prefer HTL attributes at the front (with various reasons). Does it make sense to update the corresponding rule HTL-1 accordingly?

lukasbeck avatar Sep 02 '20 15:09 lukasbeck

Hi @lukasbeck, I think it depends on a team's preferred style. A better way to go about it would be to provide another rule and allow users to choose which one to enable in a quality profile. It would be similar to how the Java plugin comes with S1105 (An open curly brace should be located at the end of a line) and S1106 (An open curly brace should be located at the beginning of a line). It's hard to think of a more famous pair of rules in direct opposition to one another :) Just reversing the behaviour of HTL-1 would be super-frustrating for teams that chose to follow it from day one.

toniedzwiedz avatar Sep 02 '20 16:09 toniedzwiedz