aboutsummaryrefslogtreecommitdiff
path: root/detekt/detekt.yml
blob: 014ca8c5a3098770b1f2fc5c630063debd745af0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
config:
    validation: true

GrammarRules:
    active: true
    AvoidBritishSpelling: # custom rule to prefer american spellings over british ones
        active: true

FormattingRules:
    active: true
    CustomCommentSpacing:
        active: true

ImportRules:
    active: true
    CustomImportOrdering:
        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
    ImportOrdering: # handled by custom rule
        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