Update kotlin linting settings (#846)

This commit is contained in:
Leendert de Borst
2025-05-28 19:55:17 +02:00
parent 2f03db7951
commit a640e4d280
3 changed files with 17 additions and 20 deletions

View File

@@ -131,6 +131,8 @@ android {
xmlReport true
htmlReport true
lintConfig file("lint.xml")
// Focus only on app/src and exclude expo modules
disable 'InvalidPackage'
}
}
@@ -224,7 +226,20 @@ ktlint {
task lintFixAll {
description = "Run all auto-fixers (ktlint and Android lint)"
group = "formatting"
dependsOn ktlintFormat, lintFix
dependsOn 'ktlintFormat'
}
task lintAll {
description = "Run all linting checks (ktlint and Android lint)"
group = "formatting"
dependsOn 'ktlintCheck'
}
// Fix for expo-dev-menu lint model generation
afterEvaluate {
tasks.withType(com.android.build.gradle.internal.lint.LintModelWriterTask).configureEach {
dependsOn(':expo-dev-menu:copyAssets')
}
}
// Add a task dependency to make ktlint run before build

View File

@@ -42,16 +42,3 @@ allprojects {
maven { url 'https://www.jitpack.io' }
}
}
// Configure ktlint
ktlint {
android = true
verbose = true
outputToConsole = true
ignoreFailures = false
enableExperimentalRules = true
filter {
exclude("**/generated/**")
include("**/kotlin/**")
}
}

View File

@@ -50,12 +50,7 @@ Linting is ran automatically during normal Android app build. You can however al
### Kotlin
```bash
./gradlew ktlintCheck
```
### Java
```bash
./gradlew lint
./gradlew lintAll
```
### Auto fix linting issues