Skip to content

Commit

Permalink
Added string exclusion length constant
Browse files Browse the repository at this point in the history
  • Loading branch information
schalkms authored and arturbosch committed Aug 19, 2017
1 parent 3d1da1a commit 648751d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class StringLiteralDuplication(config: Config = Config.empty,
val text = entry.text
when {
ignoreAnnotation && entry.isPartOf(KtAnnotationEntry::class) -> pass
excludeStringsWithLessThan5Characters && text.length < 5 -> pass
excludeStringsWithLessThan5Characters && text.length < STRING_EXCLUSION_LENGTH -> pass
text.matches(ignoreStringsRegex) -> pass
else -> add(text)
}
Expand All @@ -60,6 +60,7 @@ class StringLiteralDuplication(config: Config = Config.empty,

companion object {
const val DEFAULT_DUPLICATION = 2
const val STRING_EXCLUSION_LENGTH = 5
const val IGNORE_ANNOTATION = "ignoreAnnotation"
const val EXCLUDE_SHORT_STRING = "excludeStringsWithLessThan5Characters"
const val IGNORE_STRINGS_REGEX = "ignoreStringsRegex"
Expand Down

0 comments on commit 648751d

Please sign in to comment.