Repository navigation
Expand file tree
/
Copy path.rubocop.yml
More file actions
155 lines (155 loc) · 5.98 KB
/
Copy path.rubocop.yml
File metadata and controls
155 lines (155 loc) · 5.98 KB
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
---
plugins:
- rubocop-performance
- rubocop-hash_inspect
- rubocop-rspec
- rubocop-rspec_rails
- rubocop-factory_bot
- rubocop-capybara
AllCops:
NewCops: enable
DisplayCopNames: true
TargetRubyVersion: 3.1
Include:
- "**/*.rb"
Exclude:
- bin/*
- ".vendor/**/*"
- "**/Gemfile"
- "**/Rakefile"
- pkg/**/*
- spec/fixtures/**/*
- vendor/**/*
- "**/Puppetfile"
- "**/Vagrantfile"
- "**/Guardfile"
inherit_from: ".rubocop_todo.yml"
inherit_mode:
merge:
- Exclude
Layout/LineLength:
Description: People have wide screens, use them.
Max: 200
Layout/EndOfLine:
Description: We enforce lf to ensure consistency across platforms.
EnforcedStyle: lf
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
Exclude:
- spec/acceptance/**/*.rb
RSpec/HookArgument:
Description: Prefer explicit :each argument, matching existing module's style
EnforcedStyle: each
RSpec/DescribeSymbol:
Exclude:
- spec/unit/facter/**/*.rb
Style/BlockDelimiters:
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
be consistent then.
EnforcedStyle: braces_for_chaining
Style/ClassAndModuleChildren:
Description: Compact style reduces the required amount of indentation.
EnforcedStyle: compact
Style/EmptyElse:
Description: Enforce against empty else clauses, but allow `nil` for clarity.
EnforcedStyle: empty
Style/FormatString:
Description: Following the main puppet project's style, prefer the % format format.
EnforcedStyle: percent
Style/FormatStringToken:
Description: Following the main puppet project's style, prefer the simpler template
tokens over annotated ones.
EnforcedStyle: template
Style/Lambda:
Description: Prefer the keyword for easier discoverability.
EnforcedStyle: literal
Style/RegexpLiteral:
Description: Community preference. See https://github.com/voxpupuli/modulesync_config/issues/168
EnforcedStyle: percent_r
Style/TernaryParentheses:
Description: Checks for use of parentheses around ternary conditions. Enforce parentheses
on complex expressions for better readability, but seriously consider breaking
it up.
EnforcedStyle: require_parentheses_when_complex
Style/TrailingCommaInArguments:
Description: Prefer always trailing comma on multiline argument lists. This makes
diffs, and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/TrailingCommaInArrayLiteral:
Description: Prefer always trailing comma on multiline literals. This makes diffs,
and re-ordering nicer.
EnforcedStyleForMultiline: comma
Style/SymbolArray:
Description: Using percent style obscures symbolic intent of array's contents.
EnforcedStyle: brackets
Style/WordArray:
Description: Using percent style obscures symbolic intent of array's contents.
EnforcedStyle: brackets
Style/TrailingCommaInHashLiteral:
Description: PDK generates multiline hashes with trailing commas. Align with Style/TrailingCommaInArguments
and Style/TrailingCommaInArrayLiteral (both comma) so hash literals follow the
same project style.
EnforcedStyleForMultiline: comma
RSpec/DescribeClass:
Description: rspec-puppet describes its subject by string class/define name (no
Ruby constant exists to reference), so this cop is never satisfiable for puppet
specs. This is structurally inapplicable, not a style preference -- distinct from
D-08 which governs style cops.
Enabled: false
RSpec/MessageSpies:
Description: PDK-generated specs and the rspec-puppet convention use the mock-style
`expect(...).to receive(...)` idiom throughout, not RuboCop's default spy-style
`have_received`. Restores the setting the old `strict` profile applied globally
(no Exclude needed -- provider/transport specs already comply).
EnforcedStyle: receive
RSpec/ExampleLength:
Description: The resource-API provider specs PDK generates contain multi-line examples
covering multiple CRUD operations. Scoped to PDK-generated provider and transport
spec paths only (D-08).
Exclude:
- spec/unit/puppet/provider/**/*_spec.rb
- spec/unit/puppet/transport/**/*_spec.rb
RSpec/MultipleExpectations:
Description: The resource-API provider specs PDK generates use multiple expectations
per example to cover resource attribute checks. Scoped to PDK-generated provider
and transport spec paths only (D-08).
Exclude:
- spec/unit/puppet/provider/**/*_spec.rb
- spec/unit/puppet/transport/**/*_spec.rb
RSpec/VerifiedDoubleReference:
Description: The resource-API provider and transport specs PDK generates use string-referenced
instance doubles (the Puppet provider constant is not loaded in the spec context).
Scoped to PDK-generated provider and transport spec paths only (D-08).
Exclude:
- spec/unit/puppet/provider/**/*_spec.rb
- spec/unit/puppet/transport/**/*_spec.rb
RSpec/ContextWording:
Description: rspec-puppet-facts uses the `context "on
Prefixes:
- when
- with
- without
- 'on'
Style/MixinUsage:
Description: rspec-puppet-facts requires the top-level `include RspecPuppetFacts`
idiom in spec_helper, which cannot be cleanly restructured without breaking the
facts test harness. Scoped to spec_helper only (D-07).
Exclude:
- spec/spec_helper.rb
Lint/EmptyClass:
Description: The generated transport device file uses the idiomatic Ruby namespace
forward-declaration `class Puppet::Util::NetworkDevice; end`. An empty class is
the standard namespace-shim idiom here and is not non-idiomatic code. Scoped to
the network_device path only (D-08).
Exclude:
- lib/puppet/util/network_device/**/*.rb
Lint/BooleanSymbol:
Description: Puppet types and providers use the symbols :true and :false as parameter
and property values (e.g. newvalues(:true, :false)), and specs set and assert
them. Autocorrecting them to true/false breaks the types. Scoped to type, provider
and spec paths, matching puppet's own .rubocop.yml.
Exclude:
- lib/puppet/type/**/*.rb
- lib/puppet/provider/**/*.rb
- spec/**/*.rb