@@ -51,7 +51,28 @@ Running `./gradlew spotlessApply` automatically adds this header to any files mi
5151
5252The CI pipeline includes a copyright check that will fail if any ` .kt ` files are missing the required header.
5353
54- ### 3. Dependency Management
54+ ### 3. Static Code Analysis
55+
56+ All code must pass Detekt static analysis checks. Detekt analyzes code for:
57+ - Code complexity and potential bugs
58+ - Naming conventions
59+ - Performance issues
60+ - Code smells
61+
62+ ** Run static analysis:**
63+
64+ ``` bash
65+ ./gradlew detekt
66+ ```
67+
68+ The CI pipeline will fail if Detekt finds any issues. View the HTML report at:
69+ ```
70+ openmapview/build/reports/detekt/detekt.html
71+ ```
72+
73+ The Detekt report is also published at https://afarber.github.io/OpenMapView/detekt/
74+
75+ ### 4. Dependency Management
5576
5677Before adding new dependencies to OpenMapView, verify the following:
5778
@@ -98,8 +119,8 @@ From the repository root, run:
98119This installs a pre-commit hook that automatically:
991201 . Checks code formatting with ` ./scripts/check-format.sh `
1001212 . Checks copyright headers with ` ./scripts/check-copyright.sh `
101- 3 . Blocks the commit if any issues are found
102- 4 . Provides instructions to run ` ./gradlew spotlessApply ` to fix issues
122+ 3 . Runs Detekt static analysis with ` ./scripts/check-detekt.sh `
123+ 4 . Blocks the commit if any issues are found
103124
104125### What Happens on Commit
105126
@@ -112,6 +133,8 @@ Running pre-commit checks...
112133 Code formatting: OK
1131342. Checking copyright headers...
114135 Copyright headers: OK
136+ 3. Running Detekt static analysis...
137+ Static analysis: OK
115138
116139All pre-commit checks passed!
117140```
@@ -190,10 +213,11 @@ The CI pipeline runs automatically on all pull requests and includes:
190213
1912141 . ** Format Check** - Verifies Spotless formatting
1922152 . ** Copyright Check** - Verifies MIT license headers
193- 3 . ** Unit Tests** - Runs all JVM unit tests
194- 4 . ** Test Coverage** - Ensures minimum 20% code coverage
195- 5 . ** Build Library** - Builds the OpenMapView AAR
196- 6 . ** Build Examples** - Builds all example applications
216+ 3 . ** Static Analysis** - Runs Detekt code analysis
217+ 4 . ** Unit Tests** - Runs all JVM unit tests
218+ 5 . ** Test Coverage** - Ensures minimum 20% code coverage
219+ 6 . ** Build Library** - Builds the OpenMapView AAR
220+ 7 . ** Build Examples** - Builds all example applications
197221
198222All checks must pass before merging.
199223
@@ -206,6 +230,9 @@ All checks must pass before merging.
206230# Check formatting
207231./gradlew spotlessCheck
208232
233+ # Run static analysis
234+ ./gradlew detekt
235+
209236# Run unit tests
210237./gradlew :openmapview:test
211238
0 commit comments