Skip to content

Commit

Permalink
[#303] Update detekt ruels for Compose
Browse files Browse the repository at this point in the history
  • Loading branch information
Wadeewee committed Dec 8, 2022
1 parent 4be59c0 commit 0cefd11
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:Suppress("MagicNumber")

package co.nimblehq.sample.compose.ui.theme

import androidx.compose.ui.graphics.Color
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:Suppress("MagicNumber")

package co.nimblehq.sample.compose.ui.theme

import androidx.compose.ui.unit.dp
Expand Down
8 changes: 4 additions & 4 deletions sample-compose/detekt-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ complexity:
LongParameterList:
active: true
threshold: 5
ignoreDefaultParameters: false
ignoreDefaultParameters: true
MethodOverloading:
active: false
threshold: 5
Expand Down Expand Up @@ -189,7 +189,7 @@ naming:
FunctionNaming:
active: true
functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$'
ignoreAnnotated: [ 'Composable' ]
ignoreAnnotated: ['Composable']
MatchingDeclarationName:
active: true
MemberNameEqualsClassName:
Expand All @@ -204,7 +204,7 @@ naming:
TopLevelPropertyNaming:
active: true
constantPattern: '[A-Z][_A-Z0-9]*'
propertyPattern: '[A-Z][A-Za-z0-9]*'
propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern: '(_)?[a-z][A-Za-z0-9]*'
VariableMaxLength:
active: false
Expand Down Expand Up @@ -287,7 +287,7 @@ style:
active: true
ignoreNumbers: '-1,0,1,2'
ignoreHashCodeFunction: false
ignorePropertyDeclaration: false
ignorePropertyDeclaration: true
ignoreConstantDeclaration: true
ignoreCompanionObjectPropertyDeclaration: true
ignoreAnnotation: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import co.nimblehq.template.compose.ui.theme.Dimension.SpacingNormal
import co.nimblehq.template.compose.ui.theme.Theme
import timber.log.Timber

@Suppress("FunctionNaming")
@ExperimentalComposeUiApi
@Composable
fun HomeScreen(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package co.nimblehq.template.compose.ui.theme

import androidx.compose.ui.graphics.Color

@Suppress("MagicNumber")
object Color {
val GreenCitrus = Color(0xFF99CC00)
val GreenChristi = Color(0xFF669900)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package co.nimblehq.template.compose.ui.theme

import androidx.compose.ui.unit.dp

@Suppress("MagicNumber")
object Dimension {
val SpacingNormal = 16.dp
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.compose.material.MaterialTheme
import androidx.compose.material.lightColors
import androidx.compose.runtime.Composable

@Suppress("FunctionNaming")
@Composable
fun Theme(
content: @Composable () -> Unit
Expand Down
7 changes: 4 additions & 3 deletions template-compose/detekt-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ complexity:
LongParameterList:
active: true
threshold: 5
ignoreDefaultParameters: false
ignoreDefaultParameters: true
MethodOverloading:
active: false
threshold: 5
Expand Down Expand Up @@ -189,6 +189,7 @@ naming:
FunctionNaming:
active: true
functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$'
ignoreAnnotated: ['Composable']
MatchingDeclarationName:
active: true
MemberNameEqualsClassName:
Expand All @@ -203,7 +204,7 @@ naming:
TopLevelPropertyNaming:
active: true
constantPattern: '[A-Z][_A-Z0-9]*'
propertyPattern: '[a-z][A-Za-z\d]*'
propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern: '(_)?[a-z][A-Za-z0-9]*'
VariableMaxLength:
active: false
Expand Down Expand Up @@ -286,7 +287,7 @@ style:
active: true
ignoreNumbers: '-1,0,1,2'
ignoreHashCodeFunction: false
ignorePropertyDeclaration: false
ignorePropertyDeclaration: true
ignoreConstantDeclaration: true
ignoreCompanionObjectPropertyDeclaration: true
ignoreAnnotation: false
Expand Down

0 comments on commit 0cefd11

Please sign in to comment.