diff options
author | David Cole <40234707+DavidArthurCole@users.noreply.github.com> | 2024-09-26 03:56:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-26 09:56:44 +0200 |
commit | 092a29dd8b13c2b04b0b7c259446ab697201dd5e (patch) | |
tree | f3704e259d34bfccef083834cb9106578695a694 /detekt/detekt.yml | |
parent | e90fd65559ef551b29de7d28f4fea3a46cc2a4e6 (diff) | |
download | skyhanni-092a29dd8b13c2b04b0b7c259446ab697201dd5e.tar.gz skyhanni-092a29dd8b13c2b04b0b7c259446ab697201dd5e.tar.bz2 skyhanni-092a29dd8b13c2b04b0b7c259446ab697201dd5e.zip |
Backend: Dekekt (#2547)
Co-authored-by: Linnea Gräf <nea@nea.moe>
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Co-authored-by: Cal <cwolfson58@gmail.com>
Diffstat (limited to 'detekt/detekt.yml')
-rw-r--r-- | detekt/detekt.yml | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/detekt/detekt.yml b/detekt/detekt.yml new file mode 100644 index 000000000..1b7d3ab05 --- /dev/null +++ b/detekt/detekt.yml @@ -0,0 +1,127 @@ + +config: + validation: true + +GrammarRules: + active: true + AvoidColour: # custom rule to prefer color to colour + active: true + +FormattingRules: + active: true + CustomCommentSpacing: + active: true + + +style: + MagicNumber: # I, Linnea Gräf, of sound mind and body, disagree with disabling this rule + active: false + UnusedParameter: + active: true + ignoreAnnotated: + - 'SubscribeEvent' + - 'HandleEvent' + - 'Mod.EventHandler' + ReturnCount: + active: true + max: 5 + excludeGuardClauses: true + ignoreAnnotated: + - 'SubscribeEvent' + - 'HandleEvent' + - 'Mod.EventHandler' + MaxLineLength: + active: true + maxLineLength: 140 + excludeCommentStatements: true + LoopWithTooManyJumpStatements: + active: true + maxJumpCount: 3 + UnnecessaryAbstractClass: # gets horrendously messed up with Event classes + active: false + UnusedPrivateMember: # gets tripped up by API methods + active: false + UnusedPrivateProperty: # loops that don't use their iterator + active: true + allowedNames: "^(unused|_)$" + UseCheckOrError: + active: false + ForbiddenComment: # every TODO gets flagged + active: false + DestructuringDeclarationWithTooManyEntries: # too aggressive + active: true + maxDestructuringEntries: 5 + +formatting: + MaximumLineLength: # ktlint - handled by detekt + active: false + MultiLineIfElse: + active: false + ArgumentListWrapping: # ktlint - way too aggressive + active: false + NoBlankLineBeforeRbrace: # pedantic + active: false + NoConsecutiveBlankLines: # pedantic + active: false + NoEmptyFirstLineInMethodBlock: # pedantic + active: false + ParameterListWrapping: # pedantic, can be useful in compact code + active: false + CommentSpacing: # handled by custom rule + active: false + SpacingBetweenDeclarationsWithAnnotations: # nah + active: false + SpacingBetweenDeclarationsWithComments: # also nah + active: false + +complexity: + CyclomaticComplexMethod: # default threshold of 15, caught almost every complex method + active: true + threshold: 25 + ignoreAnnotated: + - 'SubscribeEvent' + - 'HandleEvent' + - 'Mod.EventHandler' + LongParameterList: # too aggressive, classes can need a lot of params + active: false + NestedBlockDepth: # too aggressive + active: false + TooManyFunctions: # ktlint - also way too aggressive by default (11 on all file types) + active: true + thresholdInFiles: 15 + thresholdInClasses: 20 + thresholdInInterfaces: 20 + thresholdInObjects: 20 + thresholdInEnums: 11 + ignoreAnnotated: + - 'SkyHanniModule' + ComplexCondition: # aggressive by default, at a complexity of 4 + active: true + threshold: 6 + LongMethod: # default max length of 60, caught way too much + active: true + threshold: 100 + ignoreAnnotated: + - 'SubscribeEvent' + - 'HandleEvent' + - 'Mod.EventHandler' + +exceptions: + SwallowedException: # there are valid reasons to do this + active: false + ThrowingExceptionsWithoutMessageOrCause: # again, valid reasons + active: false + TooGenericExceptionCaught: # sometimes you just need to catch Exception + active: false + TooGenericExceptionThrown: # we don't have our own custom exceptions + active: false + +naming: + ConstructorParameterNaming: # pedantic + active: false + +potential-bugs: + DoubleMutabilityForCollection: # went crazy about all the mutable collections + active: false + HasPlatformType: # false positives on config get() methods + active: false |