We are running static analysis tests on two points:
- On Git pre-commit hook, and in that case we are using phpcs, phpmd, stylelint and eslint engines (vanilla installations + Drupal Coder for Drupal standards addition)
- Once in a week we are updating our project's dashboard on SonarQube, which runs the following quality profiles: Drupal (PHP), JS and SCSS
We want to align our standards to a single standard, but using different engines makes it much harder (or even impossible?). I can think of some possible ways to achieve that:
- Manually align the rules on both pre-commit and SonarQube
- Use SonarQube for our pre-commit tests
I'm not sure about that, since by looking at the Drupal standards at SonarQube, it seems like there are much less rules there than on the Drupal PHPCS standards (from Drupal Coder) - relevant question I found about it
(also another relevant question about aligning SonarQube's PHP plugin with phpCS) - Create a custom plugin for SonarQube with our engines set (no way..)
The ideal solution in my way of thinking is to have SonarQube read the rules files (e.g. phpcs.dist.xml) in the Git repo just like most of the static analysis tools out there.
I also saw the SonarQube and stylelint Rule Mapping - which is the only mapping I found about those engines.
How can we overcome that issue in the simplest way?