Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7 detekt #19

Merged
merged 5 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/dv-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew

# - name: run detekt
# run: ./gradlew detekt
- name: run detekt
run: ./gradlew detekt

- name: Run check out script
run: ./gradlew build
Expand Down
45 changes: 32 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,36 @@
*.iml
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/captures
.externalNativeBuild
.cxx
local.properties

/.idea

# Gradle files
.gradle/
build/
out/
/.idea

# Local configuration file (sdk path, etc)
local.properties
develop.properties

# Gradle-profiler data
profile-out*/
gradle-user-home/
*.hprof

# Android Studio generated files and folders
captures/
.externalNativeBuild/
.cxx/
output.json

# Built application files
*.apk
*.aar
*.ap_
*.aab

# Google Services (e.g. APIs or Firebase)
google-services.json

# OS specific
.DS_Store
*.log
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.davay.android

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
Expand Down
3 changes: 1 addition & 2 deletions app/src/test/java/com/davay/android/ExampleUnitTest.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.davay.android

import org.junit.Assert.assertEquals
import org.junit.Test

import org.junit.Assert.*

/**
* Example local unit test, which will execute on the development machine (host).
*
Expand Down
32 changes: 32 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,36 @@ plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.jetbrainsKotlinAndroid) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.detekt)
}


tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
parallel = true
autoCorrect = false
disableDefaultRuleSets = false
buildUponDefaultConfig = true

jvmTarget = JavaVersion.valueOf(libs.versions.java.get()).toString()

setSource(files(projectDir))
include("**/*.kt")
include("**/*.kts")
exclude("**/resources/**")
exclude("**/build/**")

reports {
xml.required.set(false)
html.required.set(true)
txt.required.set(true)
sarif.required.set(false)
md.required.set(false)
}

config.setFrom(files(project.rootDir.resolve("conf/custom-detekt.yml")))
}

dependencies {
add("detekt", libs.bundles.staticAnalysis.detekt)
}
Loading
Loading