Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #94 from Team-Ladefuchs/dev/code-quality
Browse files Browse the repository at this point in the history
enable static code analysis
  • Loading branch information
thebino authored May 14, 2024
2 parents 896f876 + ba04f76 commit 23d9a7b
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,38 @@ jobs:
path: |
Ladefuchs/app/build/outputs/apk/debug/app-debug.apk
Ladefuchs/app/build/outputs/apk/release/app-release-unsigned.apk
testing:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17

- name: Write API key into build config
env:
API_TOKEN: ${{ secrets.API_KEY }}
run: echo apiKey=$API_TOKEN > Ladefuchs/secrets.properties

- name: Build fw
working-directory: Ladefuchs
run: |
./gradlew koverXmlReport
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v3
with:
name: tests
path: Ladefuchs/build/reports

- name: Add coverage report to PR
uses: mi-kas/kover-report@v1
with:
path: ${{ github.workspace }}/Ladefuchs/build/reports/kover/result.xml
token: ${{ secrets.GITHUB_TOKEN }}
title: App Coverage
update-comment: true
min-coverage-overall: 20
min-coverage-changed-files: 50
8 changes: 7 additions & 1 deletion Ladefuchs/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-parcelize'
id 'io.gitlab.arturbosch.detekt' version '1.22.0'
id 'org.jetbrains.kotlinx.kover' version '0.7.6'
}

android {
Expand Down Expand Up @@ -46,8 +48,12 @@ android {
namespace 'app.ladefuchs.android'
}

// https://detekt.dev/gradle.html
detekt {
config = files("../detekt.yml")
}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation(platform("org.jetbrains.kotlin:kotlin-bom:$kotlin_version"))
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
Expand Down
14 changes: 14 additions & 0 deletions Ladefuchs/detekt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Find all defined configuration options in the default configuration
# https://github.com/detekt/detekt/blob/main/detekt-core/src/main/resources/default-detekt-config.yml

naming:
FunctionNaming:
# adjust pattern to support compose function naming
functionPattern: '([A-Za-z][a-zA-Z0-9]*)|(`.*`)'

TopLevelPropertyNaming:
constantPattern: '[A-Z][_A-Z0-9]*'

style:
MagicNumber:
active: false

0 comments on commit 23d9a7b

Please sign in to comment.