Merge branch 'wip/19223-19230-design-docs' into 'stable'
[tails.git] / .rubocop.yml
blobd144409eded415c12e10d7c858650f3c7954a62b
1 # This file (.rubocop.yml) encodes consciously chosen deviation from Rubocop's
2 # default configuration. The jury is still out regarding other checks, which are
3 # disabled or tweaked in .rubocop_todo.yml.
5 inherit_from: .rubocop_todo.yml
7 AllCops:
8   Exclude:
9     # Let's ignore this script until we start using it and maintaining
10     # the corresponding doc-source-relationships.yml
11     - 'bin/doc-impacted-by'
12   TargetRubyVersion: 2.7
14 Layout/HashAlignment:
15   EnforcedHashRocketStyle: table
16   EnforcedColonStyle: table
18 Lint/SuppressedException:
19   AllowComments: true
21 Metrics/AbcSize:
22   Max: 30
24 Metrics/BlockLength:
25   Max: 27
26   ExcludedMethods:
27     # Rake
28     - 'namespace'
29     - 'task'
30     # Vagrant
31     - 'Vagrant.configure'
33 Metrics/ClassLength:
34   Max: 200
36 Metrics/CyclomaticComplexity:
37   Max: 9
39 Metrics/MethodLength:
40   Max: 30
42 Metrics/ParameterLists:
43   CountKeywordArgs: false
45 Metrics/PerceivedComplexity:
46   Max: 10
48 Naming/BlockParameterName:
49   AllowedNames:
50     - expected_patterns_MiB
51     - size_MiB
52     - size_in_MiB_of_destination_disk
54 Naming/MethodName:
55   IgnoredPatterns:
56     # Cucumber
57     - \A(After|Before)Feature\z
58     # Case matters: bit vs. byte
59     - _(kB|MiB)\z
60     # Stay close to Dogtail's API
61     - \A(doubleClick|roleName)\z
62     # Stay close to OpenCV's API
63     - \AmatchTemplate\z
65 Naming/MethodParameterName:
66   AllowedNames:
67     - h
68     - to
69     - vm
70     - w
71     - x
72     - y
74 Style/AccessModifierDeclarations:
75   EnforcedStyle: inline
77 Style/AsciiComments:
78   Enabled: false
80 Style/AutoResourceCleanup:
81   Enabled: true
83 Style/ClassAndModuleChildren:
84   EnforcedStyle: compact
86 Style/ClassVars:
87   Exclude:
88     - 'features/support/helpers/dogtail.rb'
89     - 'features/support/helpers/remote_shell.rb'
91 Style/CollectionMethods:
92   Enabled: true
94 Style/ConstantVisibility:
95   Enabled: true
97 Style/FrozenStringLiteralComment:
98   Enabled: false
100 Style/GlobalVars:
101   Exclude:
102     - 'Rakefile'
104 Style/GuardClause:
105   MinBodyLength: 3
107 Style/HashEachMethods:
108   Enabled: true
110 Style/HashTransformKeys:
111   Enabled: true
113 Style/HashTransformValues:
114   Enabled: true
116 Style/HashSyntax:
117   EnforcedStyle: ruby19_no_mixed_keys
119 Style/IfUnlessModifier:
120   Enabled: false
122 Style/MethodCallWithArgsParentheses:
123   Enabled: true
124   IgnoredMethods:
125     - abort
126     - assert
127     - basename
128     - chdir
129     - debug_log
130     - define
131     - delete
132     - desc
133     - exist?
134     - exit
135     - fatal_system
136     - include
137     - include?
138     - mkdir
139     - mktmpdir
140     - puts
141     - raise
142     - remove_entry_secure
143     - require
144     - require_relative
145     - returncode
146     - separator
147     - should
148     - should_not
149     - sleep
150     - start_with?
151     - step
152     - task
153     - wait
154     - warn
155     - write
156     - yield
158 Style/MethodCalledOnDoEndBlock:
159   Enabled: true
161 Style/NumericLiterals:
162   MinDigits: 6
164 Style/OptionHash:
165   Enabled: true
167 Style/ReturnNil:
168   Enabled: true
170 Style/Send:
171   Enabled: true
173 Style/SingleLineBlockParams:
174   Enabled: true
176 Style/StringMethods:
177   Enabled: true
179 Style/SymbolArray:
180   EnforcedStyle: brackets
182 Style/TrailingCommaInArguments:
183   EnforcedStyleForMultiline: no_comma
185 Style/TrailingCommaInArrayLiteral:
186   EnforcedStyleForMultiline: consistent_comma
188 Style/TrailingCommaInHashLiteral:
189   EnforcedStyleForMultiline: consistent_comma
191 Style/WordArray:
192   EnforcedStyle: brackets