it-at-m / refarch-templates

All templates for the Reference Architecture of it@M
MIT License
5 stars 3 forks source link

Java Code Linting #20

Closed devtobi closed 4 weeks ago

devtobi commented 1 month ago

Is your feature request related to a problem? Please describe. Currently only Spotless is included to standardize formatting of Java-based code. However a linter should be included in the build process as well. This helps which finding code smells and bugs.

Describe the solution you'd like A solution would be a tool like PMD or SpotBugs. Both are available as a Maven plugin.

When a solution is chosen, IDE Plugins should be supported as well.

Describe alternatives you've considered

Additional context

DanielOber commented 1 month ago

We got SonarLint, why do we need another solution?

devtobi commented 1 month ago

Is SonarLint integrated in the build chain? No. The usage of SonarLint depends on an external service (or an IDE plugin) and thus will not work under all circumstances. That's why I suggested to include PMD or SpotBugs that's directly integrated into the Maven build process. Additionally, not all projects are using SonarLint responsively. That's another reason why we should enforce the use of such tools and make those available locally as well :)

DanielOber commented 1 month ago

Before we change things for which we have internal solutions, I first ask whether integration into github is planned or possible. I opened an internal ticket to to ask about planned solutions.

devtobi commented 1 month ago

Yeah great, that's good. However I don't see it as a "one or the other" solution. For frontend projects we have ESLint in place. This a tool for code linting. It's embedded inside our build process. You could argue we don't need ESLint because SonarLint can do same things. Linting inside CI/CD and locally is not the same. That's why I suggest to add PMD or SpotBugs to support locally, independently of which solution we come up with for CI/CD.

devtobi commented 4 weeks ago

Follow up will be done in: https://github.com/it-at-m/refarch-templates/issues/177 due to a configuration problem.