IDE Integration
As a contributor it would be easier to comply to the SAT rules when they can be checked while using the openHAB Eclipse IDE. That way you don't have to run Maven commands and check SAT reports. You'd just see the PMD/Spotbugs/Checkstyle results as markers inline with your code.
All these plugins have IDE integrations. So we could:
- Add some documentation on how to setup these tools such that they generate the SAT results.
- Provide the plugins/configurations by default in the openHAB IDE.
- Create a single IDE plugin which shows the results of all tools used by SAT combined.
- Provide the plugins/configurations by default in the ESH IDE.
I researched how we could create such plugin and I saw that the eclipse checkstyle plugin does not provide the option to be called from another plugin. The checkstyle plugin only provides extension points for adding custom checks, custom rulesets and custom filters. The pmd-eclipe-plugin provides extension point for custom ruleset
Since all of our custom checks except for one are written using the checkstyle API, it would be possible to generate the same results in maven and eclipse builds. However, we would have to manually run checkstyle, PMD and then the SpotBugs plugins one by one and thus
- Create a single IDE plugin which shows the results of all tools used by SAT combined.
will not be possible.
Alternatively, I saw that SonarQube allows writing custom Java rules and allows integrating checstyle, pmd and findbugs plugins as well. The SonarLint eclipse plugin could be connected to a SonarQube server, and will allow all of our maven checks (and more) to be executed by just one plugin. This option would require a running SonarQube server and would be very convinient if the ESH project is planning on introducing SonarQube as part of the build.
These are the 3 possibilities I can think of and IMHO 1 and 2 are the best options:
- When building the openhab.sat-plugin to create maven-plugin jar as well as eclipse-plugin jar that use the same custom rules/custom configurations. This would not satisfy the requirement to
Create a single IDE plugin which shows the results of all tools used by SAT combined.
-
Introduce SonarQube for the ESH project and use SonarLint plugin.
-
Use the data from the maven generated reports to show errors in eclipse. The problem is that It would require a new maven run for changes to take effect.
@kaikreuzer @martinvw @wborn do you like any of these suggestions and can you think of something else?