-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from gravatar/hamorillo/13-detekt
Adding Detekt for static code analysis
- Loading branch information
Showing
8 changed files
with
93 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Default Config: https://github.com/detekt/detekt/blob/main/detekt-core/src/main/resources/default-detekt-config.yml | ||
# Formatting Config: https://github.com/detekt/detekt/blob/main/detekt-formatting/src/main/resources/config/config.yml | ||
# Compose Config: https://detekt.dev/docs/introduction/compose/ | ||
|
||
config: | ||
warningsAsErrors: true | ||
|
||
complexity: | ||
LongParameterList: | ||
ignoreDefaultParameters: true | ||
ignoreAnnotated: ['Inject', 'Composable'] | ||
LongMethod: | ||
ignoreAnnotated: ['Composable'] | ||
TooManyFunctions: | ||
active: false | ||
CyclomaticComplexMethod: | ||
ignoreSimpleWhenEntries: true | ||
|
||
coroutines: | ||
GlobalCoroutineUsage: | ||
active: true | ||
|
||
naming: | ||
FunctionNaming: | ||
ignoreAnnotated: ['Composable'] | ||
|
||
style: | ||
DataClassShouldBeImmutable: | ||
active: true | ||
MagicNumber: | ||
ignoreEnums: true | ||
ignoreAnnotated: ['Composable'] | ||
ignorePropertyDeclaration: true | ||
SpacingBetweenPackageAndImports: | ||
active: true | ||
UnusedImports: | ||
active: true | ||
UnusedPrivateMember: | ||
ignoreAnnotated: ['Preview'] | ||
WildcardImport: | ||
active: true | ||
excludeImports: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.gravatar | ||
|
||
object HttpResponseCode { | ||
// 4xx codes | ||
const val HTTP_CLIENT_TIMEOUT = 408 | ||
|
||
// 5xx codes | ||
private const val HTTP_INTERNAL_ERROR = 500 | ||
private const val NETWORK_CONNECT_TIMEOUT_ERROR = 599 | ||
val SERVER_ERRORS = HTTP_INTERNAL_ERROR..NETWORK_CONNECT_TIMEOUT_ERROR | ||
} |