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 Nov 13, 2024
1 parent eed07fc commit e48f4cd
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 30 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
57 changes: 27 additions & 30 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,19 +211,19 @@ 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
active: true
ObjectExtendsThrowable:
active: false
active: true
PrintStackTrace:
active: true
RethrowCaughtException:
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 @@ -293,7 +293,6 @@ naming:
parameterPattern: '[a-z][A-Za-z0-9]*'
privateParameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
ignoreOverridden: true
EnumNaming:
active: true
enumEntryPattern: '[A-Z][_a-zA-Z0-9]*'
Expand All @@ -311,27 +310,25 @@ naming:
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
functionPattern: '[a-z][a-zA-Z0-9]*'
excludeClassPattern: '$^'
ignoreOverridden: true
FunctionParameterNaming:
active: true
parameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^'
ignoreOverridden: true
InvalidPackageDeclaration:
active: false
active: true
rootPackage: ''
requireRootInDeclaration: false
LambdaParameterNaming:
active: false
active: true
parameterPattern: '[a-z][A-Za-z0-9]*|_'
MatchingDeclarationName:
active: true
mustBeFirst: true
mustBeFirst: false
MemberNameEqualsClassName:
active: true
ignoreOverridden: true
NoNameShadowing:
active: false
active: true
NonBooleanPropertyPrefixedWithIs:
active: false
ObjectPropertyNaming:
Expand Down Expand Up @@ -368,7 +365,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 +536,7 @@ style:
active: true
maxJumpCount: 1
MagicNumber:
active: true
active: false
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
ignoreNumbers:
- '-1'
Expand All @@ -562,7 +559,7 @@ style:
active: false
MaxLineLength:
active: true
maxLineLength: 120
maxLineLength: 150
excludePackageStatements: true
excludeImportStatements: true
excludeCommentStatements: false
Expand Down Expand Up @@ -610,7 +607,7 @@ style:
SpacingBetweenPackageAndImports:
active: false
ThrowsCount:
active: true
active: false
max: 2
excludeGuardClauses: false
TrailingWhitespace:
Expand Down

0 comments on commit e48f4cd

Please sign in to comment.