wttech / AEM-Rules-for-SonarQube

SonarQube plugin with set of rules detecting possible bugs and bad smells specific for AEM development.
Apache License 2.0
116 stars 50 forks source link

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

Open lukasbeck opened 4 years ago

lukasbeck commented 4 years ago

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?

toniedzwiedz commented 4 years ago

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.