Fixed detekt findings, removed test code

This commit is contained in:
Melih
2020-03-31 13:25:54 +02:00
parent 927c5c02ca
commit ef05fa7e05
12 changed files with 208 additions and 128 deletions

View File

@@ -2,7 +2,7 @@ package com.melih.abstractions.mapper
import com.melih.abstractions.data.ViewEntity import com.melih.abstractions.data.ViewEntity
abstract class Mapper<in T, out R : ViewEntity> { interface Mapper<in T, out R : ViewEntity> {
abstract fun convert(t: T): R fun convert(t: T): R
} }

View File

@@ -14,8 +14,8 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
dataBinding { buildFeatures{
enabled = true dataBinding = true
} }
} }

View File

@@ -16,9 +16,6 @@ class App : DaggerApplication() {
.create(this) .create(this)
) )
@Inject
lateinit var item: LaunchDetailItem
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()

View File

@@ -18,12 +18,4 @@ abstract class AppModule {
DetailContributor::class] DetailContributor::class]
) )
abstract fun mainActivity(): MainActivity abstract fun mainActivity(): MainActivity
@Module
companion object {
@JvmStatic
@Provides
fun provdeSomeObject() = LaunchDetailItem(10, "", "Rocket", "Desc")
}
} }

View File

@@ -7,8 +7,9 @@ apply from: "$rootProject.projectDir/scripts/default_dependencies.gradle"
apply from: "$rootProject.projectDir/scripts/sources.gradle" apply from: "$rootProject.projectDir/scripts/sources.gradle"
android { android {
dataBinding {
enabled = true buildFeatures{
dataBinding = true
} }
} }

View File

@@ -39,4 +39,4 @@ interface InteractorParameters
/** /**
* Symbolizes absence of parameters for an [interactor][BaseInteractor] * Symbolizes absence of parameters for an [interactor][BaseInteractor]
*/ */
class None : Any(), InteractorParameters class None : InteractorParameters

View File

@@ -143,21 +143,18 @@ internal class LaunchesSource @Inject constructor(
launch launch
} }
private fun transformImageUrl(imageUrl: String, supportedSizes: IntArray) = private fun transformImageUrl(imageUrl: String, supportedSizes: IntArray): String {
try { val urlSplit = imageUrl.split("_")
val urlSplit = imageUrl.split("_") val url = urlSplit[0]
val url = urlSplit[0] val format = urlSplit[1].split(".")[1]
val format = urlSplit[1].split(".")[1]
val requestedSize = if (!supportedSizes.contains(DEFAULT_IMAGE_SIZE)) { val requestedSize = if (!supportedSizes.contains(DEFAULT_IMAGE_SIZE)) {
supportedSizes.last { it < DEFAULT_IMAGE_SIZE } supportedSizes.last { it < DEFAULT_IMAGE_SIZE }
} else { } else {
DEFAULT_IMAGE_SIZE DEFAULT_IMAGE_SIZE
}
"${url}_$requestedSize.$format"
} catch (e: Exception) {
imageUrl
} }
return "${url}_$requestedSize.$format"
}
//endregion //endregion
} }

View File

@@ -10,26 +10,26 @@ import com.melih.definitions.entities.LaunchEntity
* DAO for list of [launches][LaunchEntity] * DAO for list of [launches][LaunchEntity]
*/ */
@Dao @Dao
abstract class LaunchesDao { interface LaunchesDao {
//region Queries //region Queries
@Query("SELECT * FROM Launches ORDER BY launchStartTime DESC LIMIT :count OFFSET :page*:count") @Query("SELECT * FROM Launches ORDER BY launchStartTime DESC LIMIT :count OFFSET :page*:count")
abstract suspend fun getLaunches(count: Int, page: Int): List<LaunchEntity> suspend fun getLaunches(count: Int, page: Int): List<LaunchEntity>
@Query("SELECT * FROM Launches WHERE id=:id LIMIT 1") @Query("SELECT * FROM Launches WHERE id=:id LIMIT 1")
abstract suspend fun getLaunchById(id: Long): LaunchEntity? suspend fun getLaunchById(id: Long): LaunchEntity?
@Query("DELETE FROM Launches") @Query("DELETE FROM Launches")
abstract suspend fun nukeLaunches() suspend fun nukeLaunches()
//endregion //endregion
//region Insertion //region Insertion
@Insert(onConflict = OnConflictStrategy.REPLACE) @Insert(onConflict = OnConflictStrategy.REPLACE)
abstract suspend fun saveLaunches(launches: List<LaunchEntity>) suspend fun saveLaunches(launches: List<LaunchEntity>)
@Insert(onConflict = OnConflictStrategy.REPLACE) @Insert(onConflict = OnConflictStrategy.REPLACE)
abstract suspend fun saveLaunch(launch: LaunchEntity) suspend fun saveLaunch(launch: LaunchEntity)
//endregion //endregion
} }

View File

@@ -1,40 +1,21 @@
autoCorrect: true
test-pattern: # Configure exclusions for test sources
active: true
patterns: # Test file regexes
- '.*/test/.*'
- '.*/androidTest/.*'
- '.*Test.kt'
- '.*Spec.kt'
- '.*Spek.kt'
exclude-rule-sets:
- 'comments'
exclude-rules:
- 'NamingRules'
- 'WildcardImport'
- 'MagicNumber'
- 'MaxLineLength'
- 'LateinitUsage'
- 'StringLiteralDuplication'
- 'SpreadOperator'
- 'TooManyFunctions'
- 'ForEachOnRange'
- 'FunctionMaxLength'
- 'TooGenericExceptionCaught'
- 'InstanceOfCheckForException'
build: build:
maxIssues: 1 maxIssues: 1
excludeCorrectable: false
weights: weights:
# complexity: 1 # complexity: 2
# LongParameterList: 1 # LongParameterList: 1
# style: 1 # style: 1
# comments: 0 # comments: 1
config:
validation: true
# when writing own rules with new properties, exclude the property path e.g.: 'my_rule_set,.*>.*>[my_property]'
excludes: ''
processors: processors:
active: true active: true
exclude: exclude:
- 'DetektProgressListener'
# - 'FunctionCountProcessor' # - 'FunctionCountProcessor'
# - 'PropertyCountProcessor' # - 'PropertyCountProcessor'
# - 'ClassCountProcessor' # - 'ClassCountProcessor'
@@ -44,21 +25,25 @@ processors:
console-reports: console-reports:
active: true active: true
exclude: exclude:
# - 'ProjectStatisticsReport' - 'ProjectStatisticsReport'
# - 'ComplexityReport' - 'ComplexityReport'
# - 'NotificationReport' - 'NotificationReport'
# - 'FindingsReport' # - 'FindingsReport'
# - 'BuildFailureReport' - 'FileBasedFindingsReport'
comments: comments:
active: true active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
AbsentOrWrongFileLicense:
active: false
licenseTemplateFile: 'license.template'
CommentOverPrivateFunction: CommentOverPrivateFunction:
active: false active: false
CommentOverPrivateProperty: CommentOverPrivateProperty:
active: false active: false
EndOfSentenceFormat: EndOfSentenceFormat:
active: false active: false
endOfSentenceFormat: ([.?!][ \t\n\r\f<])|([.?!]$) endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)'
UndocumentedPublicClass: UndocumentedPublicClass:
active: false active: false
searchInNestedClass: true searchInNestedClass: true
@@ -67,6 +52,8 @@ comments:
searchInInnerInterface: true searchInInnerInterface: true
UndocumentedPublicFunction: UndocumentedPublicFunction:
active: false active: false
UndocumentedPublicProperty:
active: false
complexity: complexity:
active: true active: true
@@ -77,14 +64,17 @@ complexity:
active: false active: false
threshold: 10 threshold: 10
includeStaticDeclarations: false includeStaticDeclarations: false
includePrivateDeclarations: false
ComplexMethod: ComplexMethod:
active: true active: true
threshold: 10 threshold: 15
ignoreSingleWhenExpression: false ignoreSingleWhenExpression: false
ignoreSimpleWhenEntries: false ignoreSimpleWhenEntries: false
ignoreNestingFunctions: false
nestingFunctions: run,let,apply,with,also,use,forEach,isNotNull,ifNull
LabeledExpression: LabeledExpression:
active: false active: false
ignoredLabels: "" ignoredLabels: ''
LargeClass: LargeClass:
active: true active: true
threshold: 600 threshold: 600
@@ -93,8 +83,10 @@ complexity:
threshold: 60 threshold: 60
LongParameterList: LongParameterList:
active: true active: true
threshold: 6 functionThreshold: 6
constructorThreshold: 7
ignoreDefaultParameters: false ignoreDefaultParameters: false
ignoreDataClasses: true
MethodOverloading: MethodOverloading:
active: false active: false
threshold: 6 threshold: 6
@@ -103,12 +95,14 @@ complexity:
threshold: 4 threshold: 4
StringLiteralDuplication: StringLiteralDuplication:
active: false active: false
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
threshold: 3 threshold: 3
ignoreAnnotation: true ignoreAnnotation: true
excludeStringsWithLessThan5Characters: true excludeStringsWithLessThan5Characters: true
ignoreStringsRegex: '$^' ignoreStringsRegex: '$^'
TooManyFunctions: TooManyFunctions:
active: true active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
thresholdInFiles: 11 thresholdInFiles: 11
thresholdInClasses: 11 thresholdInClasses: 11
thresholdInInterfaces: 11 thresholdInInterfaces: 11
@@ -118,11 +112,18 @@ complexity:
ignorePrivate: false ignorePrivate: false
ignoreOverridden: false ignoreOverridden: false
coroutines:
active: true
GlobalCoroutineUsage:
active: false
RedundantSuspendModifier:
active: false
empty-blocks: empty-blocks:
active: true active: true
EmptyCatchBlock: EmptyCatchBlock:
active: true active: true
allowedExceptionNameRegex: "^(_|(ignore|expected).*)" allowedExceptionNameRegex: '^(_|(ignore|expected).*)'
EmptyClassBlock: EmptyClassBlock:
active: true active: true
EmptyDefaultConstructor: EmptyDefaultConstructor:
@@ -137,7 +138,7 @@ empty-blocks:
active: true active: true
EmptyFunctionBlock: EmptyFunctionBlock:
active: true active: true
ignoreOverriddenFunctions: false ignoreOverridden: false
EmptyIfBlock: EmptyIfBlock:
active: true active: true
EmptyInitBlock: EmptyInitBlock:
@@ -146,6 +147,8 @@ empty-blocks:
active: true active: true
EmptySecondaryConstructor: EmptySecondaryConstructor:
active: true active: true
EmptyTryBlock:
active: true
EmptyWhenBlock: EmptyWhenBlock:
active: true active: true
EmptyWhileBlock: EmptyWhileBlock:
@@ -158,6 +161,7 @@ exceptions:
methodNames: 'toString,hashCode,equals,finalize' methodNames: 'toString,hashCode,equals,finalize'
InstanceOfCheckForException: InstanceOfCheckForException:
active: false active: false
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
NotImplementedDeclaration: NotImplementedDeclaration:
active: false active: false
PrintStackTrace: PrintStackTrace:
@@ -166,9 +170,11 @@ exceptions:
active: false active: false
ReturnFromFinally: ReturnFromFinally:
active: false active: false
ignoreLabeled: false
SwallowedException: SwallowedException:
active: false active: false
ignoredExceptionTypes: 'InterruptedException,NumberFormatException,ParseException,MalformedURLException' ignoredExceptionTypes: 'InterruptedException,NumberFormatException,ParseException,MalformedURLException'
allowedExceptionNameRegex: '^(_|(ignore|expected).*)'
ThrowingExceptionFromFinally: ThrowingExceptionFromFinally:
active: false active: false
ThrowingExceptionInMain: ThrowingExceptionInMain:
@@ -179,53 +185,65 @@ exceptions:
ThrowingNewInstanceOfSameException: ThrowingNewInstanceOfSameException:
active: false active: false
TooGenericExceptionCaught: TooGenericExceptionCaught:
active: false active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
exceptionNames: exceptionNames:
- ArrayIndexOutOfBoundsException - ArrayIndexOutOfBoundsException
- Error - Error
- Exception - Exception
- IllegalMonitorStateException - IllegalMonitorStateException
- NullPointerException - NullPointerException
- IndexOutOfBoundsException - IndexOutOfBoundsException
- RuntimeException - RuntimeException
- Throwable - Throwable
allowedExceptionNameRegex: "^(_|(ignore|expected).*)" allowedExceptionNameRegex: '^(_|(ignore|expected).*)'
TooGenericExceptionThrown: TooGenericExceptionThrown:
active: true active: true
exceptionNames: exceptionNames:
- Error - Error
- Exception - Exception
- Throwable - Throwable
- RuntimeException - RuntimeException
formatting: formatting:
active: true active: true
android: false android: false
autoCorrect: true autoCorrect: true
AnnotationOnSeparateLine:
active: false
autoCorrect: true
ChainWrapping: ChainWrapping:
active: true active: true
autoCorrect: true autoCorrect: true
CommentSpacing: CommentSpacing:
active: true active: true
autoCorrect: true autoCorrect: true
EnumEntryNameCase:
active: false
autoCorrect: true
Filename: Filename:
active: true active: true
FinalNewline: FinalNewline:
active: true active: true
autoCorrect: true autoCorrect: true
insertFinalNewLine: true
ImportOrdering: ImportOrdering:
active: false active: false
autoCorrect: true
Indentation: Indentation:
active: true active: false
autoCorrect: true autoCorrect: true
indentSize: 4 indentSize: 4
continuationIndentSize: 4 continuationIndentSize: 4
MaximumLineLength: MaximumLineLength:
active: true active: true
maxLineLength: 150 maxLineLength: 173
ModifierOrdering: ModifierOrdering:
active: true active: true
autoCorrect: true autoCorrect: true
MultiLineIfElse:
active: true
autoCorrect: true
NoBlankLineBeforeRbrace: NoBlankLineBeforeRbrace:
active: true active: true
autoCorrect: true autoCorrect: true
@@ -235,8 +253,9 @@ formatting:
NoEmptyClassBody: NoEmptyClassBody:
active: true active: true
autoCorrect: true autoCorrect: true
NoItParamInMultilineLambda: NoEmptyFirstLineInMethodBlock:
active: false active: false
autoCorrect: true
NoLineBreakAfterElse: NoLineBreakAfterElse:
active: true active: true
autoCorrect: true autoCorrect: true
@@ -260,7 +279,6 @@ formatting:
autoCorrect: true autoCorrect: true
NoWildcardImports: NoWildcardImports:
active: true active: true
autoCorrect: true
PackageName: PackageName:
active: true active: true
autoCorrect: true autoCorrect: true
@@ -277,6 +295,9 @@ formatting:
SpacingAroundCurly: SpacingAroundCurly:
active: true active: true
autoCorrect: true autoCorrect: true
SpacingAroundDot:
active: true
autoCorrect: true
SpacingAroundKeyword: SpacingAroundKeyword:
active: true active: true
autoCorrect: true autoCorrect: true
@@ -297,60 +318,79 @@ naming:
active: true active: true
ClassNaming: ClassNaming:
active: true active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
classPattern: '[A-Z$][a-zA-Z0-9$]*' classPattern: '[A-Z$][a-zA-Z0-9$]*'
ConstructorParameterNaming: ConstructorParameterNaming:
active: true active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
parameterPattern: '[a-z][A-Za-z0-9]*' parameterPattern: '[a-z][A-Za-z0-9]*'
privateParameterPattern: '[a-z][A-Za-z0-9]*' privateParameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^' excludeClassPattern: '$^'
ignoreOverridden: true
EnumNaming: EnumNaming:
active: true active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
enumEntryPattern: '^[A-Z][_a-zA-Z0-9]*' enumEntryPattern: '^[A-Z][_a-zA-Z0-9]*'
ForbiddenClassName: ForbiddenClassName:
active: false active: false
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
forbiddenName: '' forbiddenName: ''
FunctionMaxLength: FunctionMaxLength:
active: false active: false
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
maximumFunctionNameLength: 30 maximumFunctionNameLength: 30
FunctionMinLength: FunctionMinLength:
active: false active: false
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
minimumFunctionNameLength: 3 minimumFunctionNameLength: 3
FunctionNaming: FunctionNaming:
active: true active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$' functionPattern: '^([a-z$][a-zA-Z$0-9]*)|(`.*`)$'
excludeClassPattern: '$^' excludeClassPattern: '$^'
ignoreOverridden: true ignoreOverridden: true
FunctionParameterNaming: FunctionParameterNaming:
active: true active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
parameterPattern: '[a-z][A-Za-z0-9]*' parameterPattern: '[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^' excludeClassPattern: '$^'
ignoreOverriddenFunctions: true ignoreOverridden: true
InvalidPackageDeclaration:
active: false
rootPackage: ''
MatchingDeclarationName: MatchingDeclarationName:
active: true active: true
mustBeFirst: true
MemberNameEqualsClassName: MemberNameEqualsClassName:
active: false active: true
ignoreOverriddenFunction: true ignoreOverridden: true
ObjectPropertyNaming: ObjectPropertyNaming:
active: true active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
constantPattern: '[A-Za-z][_A-Za-z0-9]*' constantPattern: '[A-Za-z][_A-Za-z0-9]*'
propertyPattern: '[A-Za-z][_A-Za-z0-9]*' propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*' privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*'
PackageNaming: PackageNaming:
active: true active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
packagePattern: '^[a-z]+(\.[a-z][A-Za-z0-9]*)*$' packagePattern: '^[a-z]+(\.[a-z][A-Za-z0-9]*)*$'
TopLevelPropertyNaming: TopLevelPropertyNaming:
active: true active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
constantPattern: '[A-Z][_A-Z0-9]*' constantPattern: '[A-Z][_A-Z0-9]*'
propertyPattern: '[A-Za-z][_A-Za-z0-9]*' propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern: '(_)?[A-Za-z][A-Za-z0-9]*' privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*'
VariableMaxLength: VariableMaxLength:
active: false active: false
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
maximumVariableNameLength: 64 maximumVariableNameLength: 64
VariableMinLength: VariableMinLength:
active: false active: false
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
minimumVariableNameLength: 1 minimumVariableNameLength: 1
VariableNaming: VariableNaming:
active: true active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
variablePattern: '[a-z][A-Za-z0-9]*' variablePattern: '[a-z][A-Za-z0-9]*'
privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*'
excludeClassPattern: '$^' excludeClassPattern: '$^'
@@ -359,46 +399,61 @@ naming:
performance: performance:
active: true active: true
ArrayPrimitive: ArrayPrimitive:
active: false active: true
ForEachOnRange: ForEachOnRange:
active: true active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
SpreadOperator: SpreadOperator:
active: true active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
UnnecessaryTemporaryInstantiation: UnnecessaryTemporaryInstantiation:
active: true active: true
potential-bugs: potential-bugs:
active: true active: true
Deprecation:
active: false
DuplicateCaseInWhenExpression: DuplicateCaseInWhenExpression:
active: true active: true
EqualsAlwaysReturnsTrueOrFalse: EqualsAlwaysReturnsTrueOrFalse:
active: false active: true
EqualsWithHashCodeExist: EqualsWithHashCodeExist:
active: true active: true
ExplicitGarbageCollectionCall: ExplicitGarbageCollectionCall:
active: true active: true
HasPlatformType:
active: false
ImplicitDefaultLocale:
active: false
InvalidRange: InvalidRange:
active: false active: true
IteratorHasNextCallsNextMethod: IteratorHasNextCallsNextMethod:
active: false active: true
IteratorNotThrowingNoSuchElementException: IteratorNotThrowingNoSuchElementException:
active: false active: true
LateinitUsage: LateinitUsage:
active: false active: false
excludeAnnotatedProperties: "" excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
ignoreOnClassesPattern: "" excludeAnnotatedProperties: ''
ignoreOnClassesPattern: ''
MapGetWithNotNullAssertionOperator:
active: false
MissingWhenCase:
active: true
RedundantElseInWhen:
active: true
UnconditionalJumpStatementInLoop: UnconditionalJumpStatementInLoop:
active: false active: false
UnreachableCode: UnreachableCode:
active: true active: true
UnsafeCallOnNullableType: UnsafeCallOnNullableType:
active: false active: true
UnsafeCast: UnsafeCast:
active: false active: false
UselessPostfixExpression: UselessPostfixExpression:
active: false active: false
WrongEqualsTypeParameter: WrongEqualsTypeParameter:
active: false active: true
style: style:
active: true active: true
@@ -407,10 +462,14 @@ style:
DataClassContainsFunctions: DataClassContainsFunctions:
active: false active: false
conversionFunctionPrefix: 'to' conversionFunctionPrefix: 'to'
EqualsNullCall: DataClassShouldBeImmutable:
active: false active: false
EqualsNullCall:
active: true
EqualsOnSignatureLine: EqualsOnSignatureLine:
active: false active: false
ExplicitCollectionElementAccessMethod:
active: false
ExplicitItLambdaParameter: ExplicitItLambdaParameter:
active: false active: false
ExpressionBodySyntax: ExpressionBodySyntax:
@@ -419,38 +478,54 @@ style:
ForbiddenComment: ForbiddenComment:
active: true active: true
values: 'TODO:,FIXME:,STOPSHIP:' values: 'TODO:,FIXME:,STOPSHIP:'
allowedPatterns: ''
ForbiddenImport: ForbiddenImport:
active: false active: false
imports: '' imports: []
forbiddenPatterns: ''
ForbiddenMethodCall:
active: false
methods: ''
ForbiddenPublicDataClass:
active: false
ignorePackages: '*.internal,*.internal.*'
ForbiddenVoid: ForbiddenVoid:
active: false active: false
ignoreOverridden: false
ignoreUsageInGenerics: false
FunctionOnlyReturningConstant: FunctionOnlyReturningConstant:
active: false active: true
ignoreOverridableFunction: true ignoreOverridableFunction: true
excludedFunctions: 'describeContents' excludedFunctions: 'describeContents'
excludeAnnotatedFunction: 'dagger.Provides'
LibraryCodeMustSpecifyReturnType:
active: true
LoopWithTooManyJumpStatements: LoopWithTooManyJumpStatements:
active: false active: true
maxJumpCount: 1 maxJumpCount: 1
MagicNumber: MagicNumber:
active: true active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
ignoreNumbers: '-1,0,1,2' ignoreNumbers: '-1,0,1,2'
ignoreHashCodeFunction: true ignoreHashCodeFunction: true
ignorePropertyDeclaration: false ignorePropertyDeclaration: false
ignoreLocalVariableDeclaration: false
ignoreConstantDeclaration: true ignoreConstantDeclaration: true
ignoreCompanionObjectPropertyDeclaration: true ignoreCompanionObjectPropertyDeclaration: true
ignoreAnnotation: false ignoreAnnotation: false
ignoreNamedArgument: true ignoreNamedArgument: true
ignoreEnums: false ignoreEnums: false
ignoreRanges: false
MandatoryBracesIfStatements: MandatoryBracesIfStatements:
active: false active: false
MaxLineLength: MaxLineLength:
active: true active: true
maxLineLength: 150 maxLineLength: 173
excludePackageStatements: true excludePackageStatements: true
excludeImportStatements: true excludeImportStatements: true
excludeCommentStatements: false excludeCommentStatements: false
MayBeConst: MayBeConst:
active: false active: true
ModifierOrder: ModifierOrder:
active: true active: true
NestedClassesVisibility: NestedClassesVisibility:
@@ -468,15 +543,18 @@ style:
PreferToOverPairSyntax: PreferToOverPairSyntax:
active: false active: false
ProtectedMemberInFinalClass: ProtectedMemberInFinalClass:
active: true
RedundantExplicitType:
active: false active: false
RedundantVisibilityModifierRule: RedundantVisibilityModifierRule:
active: false active: false
ReturnCount: ReturnCount:
active: true active: true
max: 2 max: 2
excludedFunctions: "equals" excludedFunctions: 'equals'
excludeLabeled: false excludeLabeled: false
excludeReturnFromLambda: true excludeReturnFromLambda: true
excludeGuardClauses: false
SafeCast: SafeCast:
active: true active: true
SerialVersionUIDInSerializableClass: SerialVersionUIDInSerializableClass:
@@ -492,12 +570,14 @@ style:
active: false active: false
acceptableDecimalLength: 5 acceptableDecimalLength: 5
UnnecessaryAbstractClass: UnnecessaryAbstractClass:
active: true
excludeAnnotatedClasses: 'dagger.Module'
UnnecessaryAnnotationUseSiteTarget:
active: false active: false
excludeAnnotatedClasses: "dagger.Module"
UnnecessaryApply: UnnecessaryApply:
active: false active: false
UnnecessaryInheritance: UnnecessaryInheritance:
active: false active: true
UnnecessaryLet: UnnecessaryLet:
active: false active: false
UnnecessaryParentheses: UnnecessaryParentheses:
@@ -507,17 +587,29 @@ style:
UnusedImports: UnusedImports:
active: false active: false
UnusedPrivateClass: UnusedPrivateClass:
active: false active: true
UnusedPrivateMember: UnusedPrivateMember:
active: false active: false
allowedNames: "(_|ignored|expected|serialVersionUID)" allowedNames: '(_|ignored|expected|serialVersionUID)'
UseArrayLiteralsInAnnotations:
active: false
UseCheckOrError:
active: false
UseDataClass: UseDataClass:
active: false active: false
excludeAnnotatedClasses: "" excludeAnnotatedClasses: ''
UtilityClassWithPublicConstructor: allowVars: false
UseIfInsteadOfWhen:
active: false active: false
UseRequire:
active: false
UselessCallOnNotNull:
active: true
UtilityClassWithPublicConstructor:
active: true
VarCouldBeVal: VarCouldBeVal:
active: false active: false
WildcardImport: WildcardImport:
active: true active: true
excludes: '**/test/**,**/androidTest/**,**/*.Test.kt,**/*.Spec.kt,**/*.Spek.kt'
excludeImports: 'java.util.*,kotlinx.android.synthetic.*' excludeImports: 'java.util.*,kotlinx.android.synthetic.*'

View File

@@ -4,7 +4,7 @@ import com.melih.abstractions.mapper.Mapper
import com.melih.definitions.entities.LaunchEntity import com.melih.definitions.entities.LaunchEntity
import javax.inject.Inject import javax.inject.Inject
class LaunchDetailMapper @Inject constructor() : Mapper<LaunchEntity, LaunchDetailItem>() { class LaunchDetailMapper @Inject constructor() : Mapper<LaunchEntity, LaunchDetailItem> {
override fun convert(launchEntity: LaunchEntity) = override fun convert(launchEntity: LaunchEntity) =
with(launchEntity) { with(launchEntity) {

View File

@@ -4,7 +4,7 @@ import com.melih.abstractions.mapper.Mapper
import com.melih.definitions.entities.LaunchEntity import com.melih.definitions.entities.LaunchEntity
import javax.inject.Inject import javax.inject.Inject
class LaunchMapper @Inject constructor() : Mapper<LaunchEntity, LaunchItem>() { class LaunchMapper @Inject constructor() : Mapper<LaunchEntity, LaunchItem> {
override fun convert(launchEntity: LaunchEntity) = override fun convert(launchEntity: LaunchEntity) =
with(launchEntity) { with(launchEntity) {

View File

@@ -4,8 +4,9 @@ apply from: "$rootProject.projectDir/scripts/module.gradle"
apply from: "$rootProject.projectDir/scripts/default_dependencies.gradle" apply from: "$rootProject.projectDir/scripts/default_dependencies.gradle"
android { android {
dataBinding {
enabled = true buildFeatures{
dataBinding = true
} }
} }