Skip to content

Commit

Permalink
feat: add yml setup to execute in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jesmrec committed Oct 30, 2024
1 parent 1b0b6f9 commit f939d1f
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 21 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/detekt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This is a basic workflow that is manually triggered

name: Detekt

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
name:
# Friendly description to be shown in the UI instead of 'name'
description: 'Detekt'
# Default value if no value is explicitly provided
default: 'World'
# Input has to be provided for the workflow to run
required: true
# The data type of the input
type: string

push:
branches:
- feature/detekt
pull_request:
branches:
- "master"
paths:
- ".github/workflows/detekt.yml"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "greet"
run:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
- name: Set base line
run: ./gradlew detektBaseline
- name: module owncloudApp
run: ./gradlew detekt
- name: module owncloudDomain
run: ./gradlew owncloudDomain:detekt
- name: module owncloudData
run: ./gradlew owncloudData:detekt
- name: module owncloudComLibrary
run: ./gradlew owncloudComLibrary:detekt
- name: module owncloudTestUtil
run: ./gradlew owncloudTestUtil:detekt
42 changes: 21 additions & 21 deletions config/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ output-reports:
# - 'HtmlOutputReport'

comments:
active: true
active: false
AbsentOrWrongFileLicense:
active: false
licenseTemplateFile: 'license.template'
Expand Down Expand Up @@ -85,7 +85,7 @@ complexity:
active: true
ComplexCondition:
active: true
threshold: 4
threshold: 5
ComplexInterface:
active: false
threshold: 10
Expand All @@ -111,28 +111,28 @@ complexity:
active: false
ignoredLabels: []
LargeClass:
active: true
active: false
threshold: 600
LongMethod:
active: true
threshold: 60
threshold: 100
LongParameterList:
active: true
active: false
functionThreshold: 6
constructorThreshold: 7
ignoreDefaultParameters: false
ignoreDataClasses: true
ignoreAnnotatedParameter: []
MethodOverloading:
active: false
active: true
threshold: 6
NamedArguments:
active: false
threshold: 3
ignoreArgumentsMatchingNames: false
NestedBlockDepth:
active: true
threshold: 4
threshold: 5
ReplaceSafeCallChainWithRun:
active: false
StringLiteralDuplication:
Expand All @@ -143,7 +143,7 @@ complexity:
excludeStringsWithLessThan5Characters: true
ignoreStringsRegex: '$^'
TooManyFunctions:
active: true
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
thresholdInFiles: 11
thresholdInClasses: 11
Expand All @@ -157,21 +157,21 @@ complexity:
coroutines:
active: true
GlobalCoroutineUsage:
active: false
active: true
InjectDispatcher:
active: false
dispatcherNames:
- 'IO'
- 'Default'
- 'Unconfined'
RedundantSuspendModifier:
active: false
active: true
SleepInsteadOfDelay:
active: false
active: true
SuspendFunWithCoroutineScopeReceiver:
active: false
active: true
SuspendFunWithFlowReturnType:
active: false
active: true

empty-blocks:
active: true
Expand All @@ -192,7 +192,7 @@ empty-blocks:
active: true
EmptyFunctionBlock:
active: true
ignoreOverridden: false
ignoreOverridden: true
EmptyIfBlock:
active: true
EmptyInitBlock:
Expand All @@ -211,14 +211,14 @@ empty-blocks:
exceptions:
active: true
ExceptionRaisedInUnexpectedLocation:
active: true
active: false
methodNames:
- 'equals'
- 'finalize'
- 'hashCode'
- 'toString'
InstanceOfCheckForException:
active: false
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
NotImplementedDeclaration:
active: false
Expand Down Expand Up @@ -259,7 +259,7 @@ exceptions:
ThrowingNewInstanceOfSameException:
active: true
TooGenericExceptionCaught:
active: true
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
exceptionNames:
- 'ArrayIndexOutOfBoundsException'
Expand Down Expand Up @@ -368,7 +368,7 @@ performance:
active: true
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
SpreadOperator:
active: true
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
UnnecessaryTemporaryInstantiation:
active: true
Expand Down Expand Up @@ -539,7 +539,7 @@ style:
active: true
maxJumpCount: 1
MagicNumber:
active: true
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
ignoreNumbers:
- '-1'
Expand All @@ -562,7 +562,7 @@ style:
active: false
MaxLineLength:
active: true
maxLineLength: 120
maxLineLength: 150
excludePackageStatements: true
excludeImportStatements: true
excludeCommentStatements: false
Expand Down Expand Up @@ -610,7 +610,7 @@ style:
SpacingBetweenPackageAndImports:
active: false
ThrowsCount:
active: true
active: false
max: 2
excludeGuardClauses: false
TrailingWhitespace:
Expand Down

0 comments on commit f939d1f

Please sign in to comment.