Merge remote-tracking branch 'origin/stable' into devel
[tails.git] / .rubocop.yml
blob0dba1f4b6ecd815f19c9c2732772a8538af34653
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     # Not our code
13     - 'lib/ruby/vendor/**/*'
14   TargetRubyVersion: 3.1
16 Layout/HashAlignment:
17   EnforcedHashRocketStyle: table
18   EnforcedColonStyle: table
20 Layout/LineLength:
21   Max: 88
23 Lint/SuppressedException:
24   AllowComments: true
26 Metrics/AbcSize:
27   Max: 40
29 Metrics/BlockLength:
30   Max: 40
31   AllowedMethods:
32     # Rake
33     - 'namespace'
34     - 'task'
35     # Vagrant
36     - 'Vagrant.configure'
38 Metrics/ClassLength:
39   Max: 250
41 Metrics/CyclomaticComplexity:
42   Max: 12
44 Metrics/MethodLength:
45   Max: 45
47 Metrics/ParameterLists:
48   CountKeywordArgs: false
50 Metrics/PerceivedComplexity:
51   Max: 15
53 Naming/BlockParameterName:
54   AllowedNames:
55     - expected_patterns_MiB
56     - size_MiB
57     - size_in_MiB_of_destination_disk
59 Naming/MethodName:
60   AllowedPatterns:
61     # Cucumber
62     - \A(After|Before)Feature\z
63     # Case matters: bit vs. byte
64     - _(kB|MiB)\z
65     # Stay close to Dogtail's API
66     - \A(doubleClick|roleName)\z
67     # Stay close to OpenCV's API
68     - \AmatchTemplate\z
69     # Stay close to Dogtail's API
70     - \AchildLabelled\z
71     - \AchildNamed\z
72     - \AmenuItem\z
73     - \AdoActionNamed\z
74     - \AgrabFocus\z
76 Naming/MethodParameterName:
77   AllowedNames:
78     - h
79     - to
80     - vm
81     - w
82     - x
83     - y
85 Style/AccessModifierDeclarations:
86   EnforcedStyle: inline
88 Style/AsciiComments:
89   Enabled: false
91 Style/AutoResourceCleanup:
92   Enabled: true
94 Style/ClassAndModuleChildren:
95   EnforcedStyle: compact
97 Style/ClassVars:
98   Exclude:
99     - 'features/support/helpers/dogtail.rb'
100     - 'features/support/helpers/remote_shell.rb'
102 Style/CollectionMethods:
103   Enabled: true
105 Style/ConstantVisibility:
106   Enabled: true
108 Style/FrozenStringLiteralComment:
109   Enabled: false
111 Style/GlobalVars:
112   Exclude:
113     - 'Rakefile'
115 Style/GuardClause:
116   MinBodyLength: 3
118 Style/HashEachMethods:
119   Enabled: true
121 Style/HashTransformKeys:
122   Enabled: true
124 Style/HashTransformValues:
125   Enabled: true
127 Style/HashSyntax:
128   EnforcedStyle: ruby19_no_mixed_keys
130 Style/IfUnlessModifier:
131   Enabled: false
133 Style/MethodCallWithArgsParentheses:
134   Enabled: true
135   AllowedMethods:
136     - abort
137     - assert
138     - basename
139     - chdir
140     - debug_log
141     - define
142     - delete
143     - desc
144     - exist?
145     - exit
146     - fatal_system
147     - include
148     - include?
149     - mkdir
150     - mktmpdir
151     - puts
152     - raise
153     - remove_entry_secure
154     - require
155     - require_relative
156     - returncode
157     - separator
158     - should
159     - should_not
160     - sleep
161     - start_with?
162     - step
163     - task
164     - wait
165     - warn
166     - write
167     - yield
169 Style/MethodCalledOnDoEndBlock:
170   Enabled: true
172 Style/NumericLiterals:
173   MinDigits: 6
175 Style/OptionHash:
176   Enabled: true
178 Style/ReturnNil:
179   Enabled: true
181 Style/Send:
182   Enabled: true
184 Style/SingleLineBlockParams:
185   Enabled: true
187 Style/StringMethods:
188   Enabled: true
190 Style/SymbolArray:
191   EnforcedStyle: brackets
193 Style/TrailingCommaInArguments:
194   EnforcedStyleForMultiline: no_comma
196 Style/TrailingCommaInArrayLiteral:
197   EnforcedStyleForMultiline: consistent_comma
199 Style/TrailingCommaInHashLiteral:
200   EnforcedStyleForMultiline: consistent_comma
202 Style/WordArray:
203   EnforcedStyle: brackets