TEAMMATES uses a number of static analysis tools in order to maintain code quality. This document will cover an overview of these tools and how to run them in local environment.
The version number of all the tool stacks are declared in build.gradle
or package.json
.
Not all rules from all static analysis tools need to be followed 100% of the time; there are times where some rules need to be broken for various reasons. Most of the static analysis tools we use allow for such leeway through various means.
General rule of thumb when suppressing rules:
Note the following:
- Change
./gradlew
togradlew.bat
in Windows.- All the commands are assumed to be run from the root project folder, unless otherwise specified.
Tool name | Command |
---|---|
CheckStyle | ./gradlew checkstyleMain , ./gradlew checkstyleTest |
PMD | ./gradlew pmdMain , ./gradlew pmdTest |
SpotBugs | ./gradlew spotbugsMain , ./gradlew spotbugsTest |
ArchUnit | ./gradlew architectureTest |
ESLint | npm run lint:ts |
stylelint | npm run lint:css:syntax |
prettier | npm run lint:css:styles |
lintspaces | npm run lint:spaces |
To run all static analysis tasks in one sitting, run the following two commands:
./gradlew lint --continue
npm run lint