From cecc96d976a286faa4b1fcb8e8248c7162d39bec Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Sat, 15 Aug 2026 17:41:58 +0200 Subject: [PATCH] Remove detekt --- .github/hooks/install-pre-commit.sh | 16 --------- .github/hooks/pre-commit | 16 --------- .github/workflows/check-pr.yaml | 19 +---------- .gitignore | 1 + DEVELOPMENT.md | 27 --------------- README.md | 9 ----- build.gradle.kts | 53 ----------------------------- detekt/baseline.xml | 6 ---- detekt/config.yml | 34 ------------------ gradle/libs.versions.toml | 6 +--- 10 files changed, 3 insertions(+), 184 deletions(-) delete mode 100755 .github/hooks/install-pre-commit.sh delete mode 100644 .github/hooks/pre-commit delete mode 100644 detekt/baseline.xml delete mode 100644 detekt/config.yml diff --git a/.github/hooks/install-pre-commit.sh b/.github/hooks/install-pre-commit.sh deleted file mode 100755 index 9f5944c..0000000 --- a/.github/hooks/install-pre-commit.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env zsh - -if [ ! -f "$(pwd)/README.md" ]; then - echo "This script needs to be executed from the project root. Aborted." - exit 1 -fi - -SOURCE_FILE="$(pwd)/.github/hooks/pre-commit" -DESTINATION_FILE="$(pwd)/.git/hooks/pre-commit" - -cp $SOURCE_FILE $DESTINATION_FILE -chmod +x $DESTINATION_FILE - -if [ "$?"=="0" ]; then - echo "Installing pre-commit hook successful." -fi \ No newline at end of file diff --git a/.github/hooks/pre-commit b/.github/hooks/pre-commit deleted file mode 100644 index b652664..0000000 --- a/.github/hooks/pre-commit +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env zsh - -echo "Running detekt check..." -OUTPUT="/tmp/detekt-$(date +%s)" -./gradlew detektAll -PdetektAutoFix=true > $OUTPUT -EXIT_CODE=$? -if [ $EXIT_CODE -ne 0 ]; then - cat $OUTPUT - rm $OUTPUT - echo "***********************************************" - echo " Detekt failed " - echo " Please fix the above issues before committing " - echo "***********************************************" - exit $EXIT_CODE -fi -rm $OUTPUT \ No newline at end of file diff --git a/.github/workflows/check-pr.yaml b/.github/workflows/check-pr.yaml index 9da8064..40beae7 100644 --- a/.github/workflows/check-pr.yaml +++ b/.github/workflows/check-pr.yaml @@ -99,21 +99,4 @@ jobs: java-version: '17' - name: Run apiCheck - run: ./gradlew apiCheck - - detekt: - runs-on: macos-latest - needs: [assembleAndroidDebug, assembleAndroidRelease] - - steps: - - name: Checkout code - uses: actions/checkout@v6 - - - name: Set up JDK 17 - uses: actions/setup-java@v5 - with: - distribution: 'zulu' - java-version: '17' - - - name: Run detekt - run: ./gradlew detektAll \ No newline at end of file + run: ./gradlew apiCheck \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8e1bbcc..d29f9c4 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,7 @@ captures/ .idea/appInsightsSettings.xml .idea/ktlint-plugin.xml .idea/markdown.xml +.idea/codeStyles/ .kotlin diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index b3c44ec..bca2b88 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -2,33 +2,6 @@ Instructions on how to develop in this project. -### Detekt - -Install pre-commit hook for auto formatting: - -Run the following command from the project root. -``` -.github/hooks/install-pre-commit.sh -``` - -Run Detekt on all library modules: - -``` -./gradlew detektAll -``` - -Run Detekt on all library modules with auto-formatting enabled - -``` -./gradlew detektAll -PdetektAutoFix=true -``` - -Generate Detekt baseline - -``` -./gradlew detektGenerateBaseline -``` - ### Api validation Create or overwrite the api validation file diff --git a/README.md b/README.md index 374a26a..8ffce47 100644 --- a/README.md +++ b/README.md @@ -115,15 +115,6 @@ JsonTree can be searched for keys and values by using the `searchState` paramete - Android compileSdk 36 - JDK 17 -## Tech Stack - -- Compose Multiplatform UI -- Kotlinx Serialization -- Detekt (Linting) -- API validation -- GitHub Actions -- Gradle version catalog - ## Contributing This repository is open for contributions. However, PRs might get rejected if they don't fit the current structure or goals of the project. If you want to contribute, it might be a good idea to open a issue to describe your idea before spending a lot of time implementing it. diff --git a/build.gradle.kts b/build.gradle.kts index 5999fa4..008a6f1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,3 @@ -import io.gitlab.arturbosch.detekt.Detekt - buildscript { repositories { mavenCentral() @@ -14,60 +12,9 @@ plugins { alias(libs.plugins.compose.compiler).apply(false) alias(libs.plugins.publish).apply(false) alias(libs.plugins.api.validator) - alias(libs.plugins.detekt) alias(libs.plugins.androidKotlinMultiplatformLibrary) apply false } apiValidation { ignoredProjects.addAll(listOf("shared", "desktopApp", "webApp")) } - -val projectSource = file(projectDir) -val configFiles = files("$rootDir/detekt/config.yml") -val baselineFile = File("$rootDir/detekt/baseline.xml") -val kotlinFiles = "**/*.kt" -val sharedModuleFiles = "**/shared/**" -val desktopAppModuleFiles = "**/desktopApp/**" -val webAppModuleFiles = "**/webApp/**" -val resourceFiles = "**/resources/**" -val buildFiles = "**/build/**" -val testFiles = "**/commonTest/**" - -tasks.register("detektAll") { - val autoFix = project.hasProperty("detektAutoFix") - - description = "Custom DETEKT task for all modules" - parallel = true - ignoreFailures = false - autoCorrect = autoFix - buildUponDefaultConfig = true - setSource(projectSource) - config.setFrom(configFiles) - baseline = baselineFile - reports { - html.required = true - xml.required = false - txt.required = false - } -} - -tasks.register("detektGenerateBaseline") { - description = "Custom DETEKT task to build baseline for all modules" - parallel = true - ignoreFailures = false - buildUponDefaultConfig = true - setSource(projectSource) - baseline.set(baselineFile) - config.setFrom(configFiles) - include(kotlinFiles) - exclude(sharedModuleFiles, desktopAppModuleFiles, webAppModuleFiles, resourceFiles, buildFiles, testFiles) -} - -tasks.withType().configureEach { - include(kotlinFiles) - exclude(sharedModuleFiles, desktopAppModuleFiles, webAppModuleFiles, resourceFiles, buildFiles, testFiles) -} - -dependencies { - detektPlugins(libs.detekt.formatting) -} diff --git a/detekt/baseline.xml b/detekt/baseline.xml deleted file mode 100644 index 130c068..0000000 --- a/detekt/baseline.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/detekt/config.yml b/detekt/config.yml deleted file mode 100644 index 35bb4d0..0000000 --- a/detekt/config.yml +++ /dev/null @@ -1,34 +0,0 @@ -# Overwritten from default config at: -# https://github.com/detekt/detekt/blob/main/detekt-core/src/main/resources/default-detekt-config.yml -config: - validation: true - -naming: - FunctionNaming: - functionPattern: '[a-zA-Z][a-zA-Z0-9]*' - MatchingDeclarationName: - active: false - -complexity: - TooManyFunctions: - thresholdInFiles: 20 - LongMethod: - threshold: 200 - LongParameterList: - functionThreshold: 20 - CyclomaticComplexMethod: - threshold: 25 - LargeClass: - threshold: 1000 - -style: - MagicNumber: - active: false - UnusedPrivateMember: - ignoreAnnotated: ['Preview'] - LoopWithTooManyJumpStatements: - active: false - MaxLineLength: - active: false - - diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index afefbe7..2eae1cc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,7 +14,6 @@ androidx-activity-compose = "1.13.0" androidx-compose-ui-test = "1.11.0" kotlinx-serialization-json = "1.11.0" kotlinx-coroutines = "1.10.2" -detekt = "1.23.8" kotlindiff = "1.3.0" [libraries] @@ -37,8 +36,6 @@ androidx-compose-ui-test-android = { module = "androidx.compose.ui:ui-test-junit androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "androidx-compose-ui-test" } kotlindiff = { module = "io.github.petertrr:kotlin-multiplatform-diff", version.ref = "kotlindiff" } -detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" } - [plugins] android-application = { id = "com.android.application", version.ref = "agp" } kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } @@ -47,5 +44,4 @@ androidKotlinMultiplatformLibrary = { id = "com.android.kotlin.multiplatform.lib compose = { id = "org.jetbrains.compose", version.ref = "compose" } compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } publish = { id = "com.vanniktech.maven.publish", version.ref = "publish" } -api-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "api-validator" } -detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } \ No newline at end of file +api-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "api-validator" } \ No newline at end of file