From 0b51fcdb9282bd5cca37795089549cf8077785b7 Mon Sep 17 00:00:00 2001 From: alexban011 Date: Tue, 23 May 2023 23:15:24 +0300 Subject: [PATCH] docs: added documentation for running detekt (#9443) * docs: added documentation for running detekt * docs: added note for windows users --- docs/Developers/Building-Locally.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/Developers/Building-Locally.md b/docs/Developers/Building-Locally.md index 9dc2c20ad8..8c0a1a491e 100644 --- a/docs/Developers/Building-Locally.md +++ b/docs/Developers/Building-Locally.md @@ -99,6 +99,16 @@ You can (and in some cases _should_) run and even debug the unit tests locally. - Under "Gradle Project", choose "Unciv" from the dropdown (or type it), set "Tasks" to `:tests:test` and "Arguments" to `--tests "com.unciv.*"`, OK to close the window. - Select the "Unit Tests" configuration and click the green arrow button to run! Or start a debug session as above. +## Code Smells + +You can run `detekt` to check for code smells and other linting issues. To do so download [detekt-cli](https://github.com/detekt/detekt/releases/latest) (the zip file) and unzip it. Then to generate the reports go to the Unciv top directory and run one of the following commands to generate the report. NOTE: If you're using windows, replace `detekt-cli` with `detekt-cli.bat`. +- For detecting warnings: `PATH/TO/DETEKT/detekt-cli --parallel --report html:detekt/reports.html --config detekt/config/detekt-warnings.yml + ` +- For detecting errors: `PATH/TO/DETEKT/detekt-cli --parallel --report html:detekt/reports.html --config detekt/config/detekt-errors.yml + ` + +Then you can find the report in detekt/reports.html + ## Next steps Congratulations! Unciv should now be running on your computer! Now we can start changing some code, and later we'll see how your changes make it into the main repository!