|
1 | | -require: rubocop-rspec |
| 1 | +inherit_from: .rubocop_todo.yml |
| 2 | + |
| 3 | +require: |
| 4 | + - rubocop-performance |
| 5 | + - rubocop-rspec |
2 | 6 |
|
3 | 7 | AllCops: |
4 | | - TargetRubyVersion: 2.5 |
5 | 8 | Exclude: |
6 | | - # binstubs, and other utilities |
7 | | - - bin/**/* |
8 | | - - vendor/**/* |
9 | | - - vendor/**/.* |
10 | | - # package testing gems |
11 | | - - package-testing/vendor/**/* |
12 | | - - package-testing/vendor/**/.* |
13 | | - # Any thing in test fixtures |
| 9 | + - Gemfile |
| 10 | + - Rakefile |
14 | 11 | - spec/fixtures/**/* |
| 12 | + - vendor/bundle/**/* |
| 13 | + NewCops: enable |
| 14 | + SuggestExtensions: false |
| 15 | + TargetRubyVersion: '2.7' |
15 | 16 |
|
16 | | -# Metrics, excludes complexity and sizing metrics for now, as ruby's defaults are very strict |
17 | | -Metrics/AbcSize: |
18 | | - Enabled: False |
19 | | - |
20 | | -Metrics/BlockLength: |
21 | | - Description: rspec uses long describe blocks, so allow long blocks under spec/ |
22 | | - Enabled: False |
23 | | - Exclude: |
24 | | - - 'spec/**/*.rb' |
25 | | - |
26 | | -Metrics/ClassLength: |
27 | | - Enabled: False |
28 | | - |
29 | | -Metrics/CyclomaticComplexity: |
30 | | - Enabled: False |
31 | | - |
32 | | -Layout/LineLength: |
33 | | - Description: People have wide screens, use them. |
34 | | - Max: 200 |
35 | | - |
36 | | -Metrics/MethodLength: |
37 | | - Enabled: False |
38 | | - |
39 | | -Metrics/ModuleLength: |
40 | | - Enabled: False |
41 | | - |
42 | | -Metrics/ParameterLists: |
43 | | - Enabled: False |
44 | | - |
45 | | -Metrics/PerceivedComplexity: |
46 | | - Enabled: False |
47 | | - |
48 | | -# RSpec cops |
49 | | -RSpec/BeforeAfterAll: |
50 | | - Description: Beware of using after(:all) as it may cause state to leak between tests. A necessary evil in acceptance testing. |
51 | | - Exclude: |
52 | | - - 'spec/acceptance/**/*.rb' |
53 | | - - 'package-testing/spec/package/**/*.rb' |
54 | | - |
55 | | -RSpec/DescribeClass: |
56 | | - Description: This cop does not account for rspec-puppet, and beaker-rspec usage. |
57 | | - Enabled: False |
58 | | - |
59 | | -RSpec/HookArgument: |
60 | | - Description: Prefer explicit :each argument, matching existing module's style |
61 | | - EnforcedStyle: each |
62 | | - |
63 | | -RSpec/NestedGroups: |
64 | | - Description: Nested groups can lead to cleaner tests with less duplication |
65 | | - Max: 10 |
66 | | - |
67 | | -RSpec/ExampleLength: |
68 | | - Description: Forcing short examples leads to the creation of one-time use let() helpers |
69 | | - Enabled: False |
70 | | - |
71 | | -RSpec/MessageSpies: |
72 | | - EnforcedStyle: receive |
73 | | - |
74 | | -RSpec/ScatteredSetup: |
75 | | - Enabled: False |
76 | | - |
77 | | -# This is fine |
78 | | -RSpec/ImplicitSubject: |
79 | | - Enabled: false |
80 | | - |
81 | | -# Set a reasonble max level |
82 | | -RSpec/MultipleExpectations: |
83 | | - Max: 10 |
84 | | - |
85 | | -# Nested contexts don't comply |
86 | | -RSpec/ContextWording: |
87 | | - Enabled: false |
88 | | - |
89 | | -# This is allowed |
90 | | -RSpec/SubjectStub: |
91 | | - Enabled: false |
92 | | - |
93 | | -# Doesn't help readability |
94 | | -RSpec/PredicateMatcher: |
95 | | - Enabled: false |
96 | | - |
97 | | -# Style Cops |
98 | | -Style/AsciiComments: |
99 | | - Description: Names, non-english speaking communities. |
100 | | - Enabled: False |
101 | | - |
102 | | -Style/BlockDelimiters: |
103 | | - Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to be consistent then. |
104 | | - EnforcedStyle: braces_for_chaining |
105 | | - |
| 17 | +# Disabled |
106 | 18 | Style/ClassAndModuleChildren: |
107 | | - Description: Compact style reduces the required amount of indentation. |
108 | | - EnforcedStyle: compact |
109 | | - |
110 | | -Style/EmptyElse: |
111 | | - Description: Enforce against empty else clauses, but allow `nil` for clarity. |
112 | | - EnforcedStyle: empty |
113 | | - |
114 | | -Style/FormatString: |
115 | | - Description: Following the main puppet project's style, prefer the % format format. |
116 | | - EnforcedStyle: percent |
117 | | - |
118 | | -Style/FormatStringToken: |
119 | | - Description: Following the main puppet project's style, prefer the simpler template tokens over annotated ones. |
120 | | - EnforcedStyle: template |
121 | | - |
122 | | -Style/IfUnlessModifier: |
123 | | - Description: Post-fix `if` modifiers are hard to parse for newcomers. We don't want to encourage them. Post-fix `unless` modifiers could be nice in some cases, but the Cop doesn't differentiate. |
124 | | - Enabled: false |
125 | | - |
126 | | -Style/Lambda: |
127 | | - Description: Prefer the keyword for easier discoverability. |
128 | | - EnforcedStyle: literal |
129 | | - |
130 | | -Style/MethodCalledOnDoEndBlock: |
131 | | - Enabled: true |
132 | | - |
133 | | -Style/RegexpLiteral: |
134 | | - Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168 |
135 | | - EnforcedStyle: percent_r |
136 | | - |
137 | | -Style/SymbolProc: |
138 | | - Description: SymbolProc notation is not discoverable |
139 | 19 | Enabled: false |
140 | | - |
141 | | -Style/TernaryParentheses: |
142 | | - Description: Checks for use of parentheses around ternary conditions. Enforce parentheses on complex expressions for better readability, but seriously consider breaking it up. |
143 | | - EnforcedStyle: require_parentheses_when_complex |
144 | | - |
145 | | -Style/TrailingCommaInArguments: |
146 | | - Description: Prefer always trailing comma on multiline argument lists. This makes diffs, and re-ordering nicer. |
147 | | - EnforcedStyleForMultiline: comma |
148 | | - |
149 | | -Style/TrailingCommaInArrayLiteral: |
150 | | - Description: Prefer always trailing comma on multiline literals. This makes diffs, and re-ordering nicer. |
151 | | - EnforcedStyleForMultiline: comma |
152 | | - |
153 | | -Style/TrailingCommaInHashLiteral: |
154 | | - Description: Prefer always trailing comma on multiline literals. This makes diffs, and re-ordering nicer. |
155 | | - EnforcedStyleForMultiline: comma |
156 | | - |
157 | | -Style/SymbolArray: |
158 | | - Description: Using percent style obscures symbolic intent of array's contents. |
159 | | - Enabled: true |
160 | | - EnforcedStyle: brackets |
161 | | - |
162 | | -Style/HashEachMethods: |
163 | | - Enabled: true |
164 | | - |
165 | | -Style/HashTransformKeys: |
166 | | - Enabled: true |
167 | | - |
168 | | -Style/HashTransformValues: |
169 | | - Enabled: true |
170 | | - |
171 | | -# Enforce LF line endings, even when on Windows |
172 | | -Layout/EndOfLine: |
173 | | - EnforcedStyle: lf |
174 | | - |
175 | | -# new as of rubocop 0.81 |
176 | | -Lint/RaiseException: |
177 | | - Enabled: true |
178 | | - |
179 | | -Lint/StructNewOverride: |
180 | | - Enabled: true |
181 | | - |
182 | | -RSpec/MultipleMemoizedHelpers: |
183 | | - Max: 14 |
0 commit comments