Linters
Development on the Java wrapper may involve changes in either the Java or Rust code. Each language has distinct linter tests that must be passed before committing changes.
Firstly, install the Rust linter
# Run from the `java` folder# Will only need to run once during the installation processrustup component add clippy rustfmtcargo clippy --all-features --all-targets -- -D warningscargo fmt --manifest-path ./Cargo.toml --allLanguage-specific Linters and Static Code Analysis
Section titled “Language-specific Linters and Static Code Analysis”Java: For Java, we use Spotless and SpotBugs.
-
Spotless
Terminal window # Run from the `java` folder./gradlew :spotlessCheck # run first to see if there are any linting changes to make./gradlew :spotlessApply # to apply these changes -
SpotBugs
To run SpotBugs and generate reports:
Terminal window # Run from the `java` folder./gradlew spotbugsMainThis command will generate HTML and XML reports in the
build/reports/spotbugs/directory.To view the SpotBugs findings:
- Open the HTML report located at
build/reports/spotbugs/main/spotbugs.htmlin a web browser. - If you are using IntellJ Idea - open
build/reports/spotbugs/main/spotbugs.xmlin SpotBugs plugin as it will provide better experience.
Ensure any new findings are addressed and fixed before committing and pushing your changes.
- Open the HTML report located at