Merge branch '20338-ruff-ci-job-still-broken' into 'stable'
[tails.git] / .rubocop.yml
blobb36c4d3a4a829a62760cd8f7d8cfd58570a3e795
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: 3.1
14 Layout/HashAlignment:
15   EnforcedHashRocketStyle: table
16   EnforcedColonStyle: table
18 Layout/LineLength:
19   Max: 88
21 Lint/SuppressedException:
22   AllowComments: true
24 Metrics/AbcSize:
25   Max: 40
27 Metrics/BlockLength:
28   Max: 40
29   AllowedMethods:
30     # Rake
31     - 'namespace'
32     - 'task'
33     # Vagrant
34     - 'Vagrant.configure'
36 Metrics/ClassLength:
37   Max: 250
39 Metrics/CyclomaticComplexity:
40   Max: 12
42 Metrics/MethodLength:
43   Max: 45
45 Metrics/ParameterLists:
46   CountKeywordArgs: false
48 Metrics/PerceivedComplexity:
49   Max: 15
51 Naming/BlockParameterName:
52   AllowedNames:
53     - expected_patterns_MiB
54     - size_MiB
55     - size_in_MiB_of_destination_disk
57 Naming/MethodName:
58   AllowedPatterns:
59     # Cucumber
60     - \A(After|Before)Feature\z
61     # Case matters: bit vs. byte
62     - _(kB|MiB)\z
63     # Stay close to Dogtail's API
64     - \A(doubleClick|roleName)\z
65     # Stay close to OpenCV's API
66     - \AmatchTemplate\z
67     # Stay close to Dogtail's API
68     - \AchildLabelled\z
69     - \AchildNamed\z
70     - \AmenuItem\z
71     - \AdoActionNamed\z
72     - \AgrabFocus\z
74 Naming/MethodParameterName:
75   AllowedNames:
76     - h
77     - to
78     - vm
79     - w
80     - x
81     - y
83 Style/AccessModifierDeclarations:
84   EnforcedStyle: inline
86 Style/AsciiComments:
87   Enabled: false
89 Style/AutoResourceCleanup:
90   Enabled: true
92 Style/ClassAndModuleChildren:
93   EnforcedStyle: compact
95 Style/ClassVars:
96   Exclude:
97     - 'features/support/helpers/dogtail.rb'
98     - 'features/support/helpers/remote_shell.rb'
100 Style/CollectionMethods:
101   Enabled: true
103 Style/ConstantVisibility:
104   Enabled: true
106 Style/FrozenStringLiteralComment:
107   Enabled: false
109 Style/GlobalVars:
110   Exclude:
111     - 'Rakefile'
113 Style/GuardClause:
114   MinBodyLength: 3
116 Style/HashEachMethods:
117   Enabled: true
119 Style/HashTransformKeys:
120   Enabled: true
122 Style/HashTransformValues:
123   Enabled: true
125 Style/HashSyntax:
126   EnforcedStyle: ruby19_no_mixed_keys
128 Style/IfUnlessModifier:
129   Enabled: false
131 Style/MethodCallWithArgsParentheses:
132   Enabled: true
133   AllowedMethods:
134     - abort
135     - assert
136     - basename
137     - chdir
138     - debug_log
139     - define
140     - delete
141     - desc
142     - exist?
143     - exit
144     - fatal_system
145     - include
146     - include?
147     - mkdir
148     - mktmpdir
149     - puts
150     - raise
151     - remove_entry_secure
152     - require
153     - require_relative
154     - returncode
155     - separator
156     - should
157     - should_not
158     - sleep
159     - start_with?
160     - step
161     - task
162     - wait
163     - warn
164     - write
165     - yield
167 Style/MethodCalledOnDoEndBlock:
168   Enabled: true
170 Style/NumericLiterals:
171   MinDigits: 6
173 Style/OptionHash:
174   Enabled: true
176 Style/ReturnNil:
177   Enabled: true
179 Style/Send:
180   Enabled: true
182 Style/SingleLineBlockParams:
183   Enabled: true
185 Style/StringMethods:
186   Enabled: true
188 Style/SymbolArray:
189   EnforcedStyle: brackets
191 Style/TrailingCommaInArguments:
192   EnforcedStyleForMultiline: no_comma
194 Style/TrailingCommaInArrayLiteral:
195   EnforcedStyleForMultiline: consistent_comma
197 Style/TrailingCommaInHashLiteral:
198   EnforcedStyleForMultiline: consistent_comma
200 Style/WordArray:
201   EnforcedStyle: brackets