Skip to content

Commit 3c325f9

Browse files
committed
rubocop fixes (batch 1)
* apply safe autocorrect * fix Style/MutableConstant * fix Style/NumericPredicate * fix Style/AndOr * fix Style/ZeroLengthPredicate * fix Style/SymbolProc * fix Style/SelectByRegexp * fix Style/ClassEqualityComparison * fix Style/GlobalStdStream * fix Style/RedundantParentheses * fix Security/JSONLoad * fix Style/HashEachMethods * fix Style/PreferredHashMethods
1 parent dae67d4 commit 3c325f9

59 files changed

Lines changed: 1291 additions & 1117 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.rubocop.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
inherit_from: .rubocop_todo.yml
3+
inherit_gem:
4+
voxpupuli-rubocop: rubocop.yml
5+
6+
# Exclude externalsources also
7+
AllCops:
8+
Exclude:
9+
- vendor/**/*
10+
- .vendor/**/*
11+
- spec/fixtures/**/*
12+
- externalsources/**/*
13+
- output/**/*

.rubocop_todo.yml

Lines changed: 313 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,313 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2026-02-04 04:17:01 UTC using RuboCop version 1.81.7.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
9+
# Offense count: 1
10+
# Configuration parameters: Severity.
11+
Gemspec/RequiredRubyVersion:
12+
Exclude:
13+
- 'puppet_docs.gemspec'
14+
15+
# Offense count: 1
16+
# This cop supports unsafe autocorrection (--autocorrect-all).
17+
# Configuration parameters: RequireParenthesesForMethodChains.
18+
Lint/AmbiguousRange:
19+
Exclude:
20+
- 'lib/puppet_docs/auto_redirects.rb'
21+
22+
# Offense count: 1
23+
# This cop supports unsafe autocorrection (--autocorrect-all).
24+
# Configuration parameters: AllowSafeAssignment.
25+
Lint/AssignmentInCondition:
26+
Exclude:
27+
- 'source/_plugins/partial.rb'
28+
29+
# Offense count: 4
30+
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
31+
Lint/DuplicateBranch:
32+
Exclude:
33+
- 'lib/puppet_references/puppet/type.rb'
34+
- 'source/_plugins/check_links_hook.rb'
35+
- 'source/_plugins/sitemap_generator.rb'
36+
37+
# Offense count: 1
38+
Lint/MixedRegexpCaptureTypes:
39+
Exclude:
40+
- 'source/_plugins/partial.rb'
41+
42+
# Offense count: 2
43+
# This cop supports unsafe autocorrection (--autocorrect-all).
44+
Lint/NonAtomicFileOperation:
45+
Exclude:
46+
- 'Rakefile'
47+
48+
# Offense count: 1
49+
# Configuration parameters: AllowComments, AllowNil.
50+
Lint/SuppressedException:
51+
Exclude:
52+
- 'source/_plugins/sitemap_generator.rb'
53+
54+
# Offense count: 5
55+
Naming/AccessorMethodName:
56+
Exclude:
57+
- 'lib/puppet_references/puppet/man.rb'
58+
- 'lib/puppet_references/puppet/type.rb'
59+
- 'lib/puppet_references/puppet/type_strings.rb'
60+
- 'lib/puppet_references/version_tables/data/agent.rb'
61+
62+
# Offense count: 3
63+
# Configuration parameters: ForbiddenDelimiters.
64+
# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$))
65+
Naming/HeredocDelimiterNaming:
66+
Exclude:
67+
- 'lib/puppet_references/puppet/man.rb'
68+
- 'lib/puppet_references/util.rb'
69+
- 'source/_plugins/partial.rb'
70+
71+
# Offense count: 1
72+
# Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
73+
# AllowedMethods: call
74+
# WaywardPredicates: nonzero?
75+
Naming/PredicateMethod:
76+
Exclude:
77+
- 'source/_plugins/sitemap_generator.rb'
78+
79+
# Offense count: 1
80+
# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs.
81+
# NamePrefix: is_, has_, have_, does_
82+
# ForbiddenPrefixes: is_, has_, have_, does_
83+
# AllowedMethods: is_a?
84+
# MethodDefinitionMacros: define_method, define_singleton_method
85+
Naming/PredicatePrefix:
86+
Exclude:
87+
- 'spec/**/*'
88+
- 'lib/puppet_references.rb'
89+
90+
# Offense count: 2
91+
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
92+
# SupportedStyles: snake_case, normalcase, non_integer
93+
# AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
94+
Naming/VariableNumber:
95+
Exclude:
96+
- 'lib/puppet_references.rb'
97+
- 'lib/puppet_references/version_tables/data/agent.rb'
98+
99+
# Offense count: 2
100+
# Configuration parameters: MinSize.
101+
Performance/CollectionLiteralInLoop:
102+
Exclude:
103+
- 'lib/puppet_references/puppet/type.rb'
104+
- 'lib/puppet_references/version_tables/data/pe.rb'
105+
106+
# Offense count: 1
107+
# This cop supports unsafe autocorrection (--autocorrect-all).
108+
# Configuration parameters: SafeMultiline.
109+
Performance/DeletePrefix:
110+
Exclude:
111+
- 'lib/puppet_docs/config.rb'
112+
113+
# Offense count: 1
114+
# This cop supports unsafe autocorrection (--autocorrect-all).
115+
Performance/Detect:
116+
Exclude:
117+
- 'source/_plugins/markdown_blocks.rb'
118+
119+
# Offense count: 2
120+
# This cop supports unsafe autocorrection (--autocorrect-all).
121+
Performance/MapCompact:
122+
Exclude:
123+
- 'lib/puppet_docs/config.rb'
124+
- 'lib/puppet_docs/versions.rb'
125+
126+
# Offense count: 1
127+
# This cop supports unsafe autocorrection (--autocorrect-all).
128+
Performance/StringInclude:
129+
Exclude:
130+
- 'lib/puppet_references/version_tables/data/pe.rb'
131+
132+
# Offense count: 11
133+
# This cop supports safe autocorrection (--autocorrect).
134+
Rake/Desc:
135+
Exclude:
136+
- 'Rakefile'
137+
138+
# Offense count: 2
139+
Rake/MethodDefinitionInTask:
140+
Exclude:
141+
- 'Rakefile'
142+
143+
# Offense count: 1
144+
# This cop supports unsafe autocorrection (--autocorrect-all).
145+
# Configuration parameters: EnforcedStyle, EnforcedStyleForClasses, EnforcedStyleForModules.
146+
# SupportedStyles: nested, compact
147+
# SupportedStylesForClasses: ~, nested, compact
148+
# SupportedStylesForModules: ~, nested, compact
149+
Style/ClassAndModuleChildren:
150+
Exclude:
151+
- 'source/_plugins/sitemap_generator.rb'
152+
153+
# Offense count: 3
154+
Style/ClassVars:
155+
Exclude:
156+
- 'lib/puppet_references/puppet/strings.rb'
157+
158+
# Offense count: 1
159+
# This cop supports unsafe autocorrection (--autocorrect-all).
160+
Style/CombinableLoops:
161+
Exclude:
162+
- 'lib/puppet_docs/config.rb'
163+
164+
# Offense count: 1
165+
# This cop supports unsafe autocorrection (--autocorrect-all).
166+
Style/CommentedKeyword:
167+
Exclude:
168+
- 'lib/puppet_references/util.rb'
169+
170+
# Offense count: 43
171+
# Configuration parameters: AllowedConstants.
172+
Style/Documentation:
173+
Enabled: false
174+
175+
# Offense count: 57
176+
# This cop supports unsafe autocorrection (--autocorrect-all).
177+
# Configuration parameters: EnforcedStyle.
178+
# SupportedStyles: always, always_true, never
179+
Style/FrozenStringLiteralComment:
180+
Enabled: false
181+
182+
# Offense count: 5
183+
# Configuration parameters: AllowedVariables.
184+
Style/GlobalVars:
185+
Exclude:
186+
- 'util/bbedit_tools/Markdown_with_kramdown.rb'
187+
188+
# Offense count: 3
189+
# This cop supports unsafe autocorrection (--autocorrect-all).
190+
# Configuration parameters: AllowSplatArgument.
191+
Style/HashConversion:
192+
Exclude:
193+
- 'lib/puppet_references/version_tables/data/agent.rb'
194+
- 'lib/puppet_references/version_tables/data/pe.rb'
195+
196+
# Offense count: 1
197+
# This cop supports unsafe autocorrection (--autocorrect-all).
198+
Style/HashTransformKeys:
199+
Exclude:
200+
- 'lib/puppet_references/util.rb'
201+
202+
# Offense count: 1
203+
# This cop supports unsafe autocorrection (--autocorrect-all).
204+
Style/HashTransformValues:
205+
Exclude:
206+
- 'lib/puppet_docs/config.rb'
207+
208+
# Offense count: 8
209+
# This cop supports safe autocorrection (--autocorrect).
210+
Style/IfUnlessModifier:
211+
Exclude:
212+
- 'Rakefile'
213+
- 'lib/puppet_references/puppet/type_strings.rb'
214+
- 'lib/puppet_references/quarantine/get_typedocs.rb'
215+
- 'lib/puppet_references/version_tables/data/agent.rb'
216+
- 'lib/puppet_references/version_tables/data/pe.rb'
217+
218+
# Offense count: 3
219+
# This cop supports unsafe autocorrection (--autocorrect-all).
220+
# Configuration parameters: InverseMethods, InverseBlocks.
221+
Style/InverseMethods:
222+
Exclude:
223+
- 'lib/puppet_docs/config.rb'
224+
- 'lib/puppet_references/puppet/man.rb'
225+
- 'source/_plugins/limited_preview_hook.rb'
226+
227+
# Offense count: 1
228+
# This cop supports unsafe autocorrection (--autocorrect-all).
229+
Style/MinMaxComparison:
230+
Exclude:
231+
- 'source/_plugins/sitemap_generator.rb'
232+
233+
# Offense count: 1
234+
Style/MixinUsage:
235+
Exclude:
236+
- 'lib/puppet_references/quarantine/get_typedocs.rb'
237+
238+
# Offense count: 3
239+
Style/MultilineBlockChain:
240+
Exclude:
241+
- 'Rakefile'
242+
- 'lib/puppet_references/puppet/type_strings.rb'
243+
- 'source/_plugins/change_baseurl.rb'
244+
245+
# Offense count: 2
246+
Style/OpenStructUse:
247+
Exclude:
248+
- 'lib/puppet_references/puppet/functions.rb'
249+
- 'lib/puppet_references/puppet/type.rb'
250+
251+
# Offense count: 1
252+
# Configuration parameters: AllowedMethods.
253+
# AllowedMethods: respond_to_missing?
254+
Style/OptionalBooleanParameter:
255+
Exclude:
256+
- 'lib/puppet_references/puppet/strings.rb'
257+
258+
# Offense count: 1
259+
# This cop supports unsafe autocorrection (--autocorrect-all).
260+
# Configuration parameters: EnforcedStyle, AllowedCompactTypes.
261+
# SupportedStyles: compact, exploded
262+
Style/RaiseArgs:
263+
Exclude:
264+
- 'source/_plugins/partial.rb'
265+
266+
# Offense count: 2
267+
# This cop supports unsafe autocorrection (--autocorrect-all).
268+
Style/RedundantInterpolation:
269+
Exclude:
270+
- 'Rakefile'
271+
- 'lib/puppet_references/puppet/man.rb'
272+
273+
# Offense count: 1
274+
# This cop supports unsafe autocorrection (--autocorrect-all).
275+
Style/RedundantSort:
276+
Exclude:
277+
- 'lib/puppet_references/version_tables/data/agent.rb'
278+
279+
# Offense count: 1
280+
# This cop supports unsafe autocorrection (--autocorrect-all).
281+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
282+
# AllowedMethods: present?, blank?, presence, try, try!
283+
Style/SafeNavigation:
284+
Exclude:
285+
- 'source/_plugins/partial.rb'
286+
287+
# Offense count: 3
288+
# This cop supports unsafe autocorrection (--autocorrect-all).
289+
Style/SlicingWithRange:
290+
Exclude:
291+
- 'lib/puppet_docs/auto_redirects.rb'
292+
- 'lib/puppet_references/repo.rb'
293+
- 'source/_plugins/partial.rb'
294+
295+
# Offense count: 1
296+
# This cop supports unsafe autocorrection (--autocorrect-all).
297+
# Configuration parameters: RequireEnglish.
298+
# SupportedStyles: use_perl_names, use_english_names, use_builtin_english_names
299+
Style/SpecialGlobalVars:
300+
EnforcedStyle: use_perl_names
301+
302+
# Offense count: 64
303+
# This cop supports unsafe autocorrection (--autocorrect-all).
304+
# Configuration parameters: Mode.
305+
Style/StringConcatenation:
306+
Enabled: false
307+
308+
# Offense count: 45
309+
# This cop supports safe autocorrection (--autocorrect).
310+
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
311+
# URISchemes: http, https
312+
Layout/LineLength:
313+
Max: 433

Gemfile

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,39 @@
11
source 'https://rubygems.org/'
2-
gemspec :name => 'puppet_docs'
2+
gemspec name: 'puppet_docs'
33

4-
gem 'versionomy', '~> 0.5.0'
5-
gem 'rake', '~> 13.0', '>= 13.0.1'
6-
gem 'rack', '>= 2.2.14'
74
gem 'git', '~> 4.0'
85
gem 'json', '~> 2.5'
6+
gem 'rack', '>= 2.2.14'
7+
gem 'rake', '~> 13.0', '>= 13.0.1'
8+
gem 'versionomy', '~> 0.5.0'
99

1010
group(:build_site) do
1111
gem 'jekyll', '~> 4.1'
1212
gem 'kramdown', '~> 2.3'
13+
gem 'listen', '~> 3.10.0' # Preserve ability to run on Ruby 2.0, since listen 3.1 requires Ruby ~> 2.2.
1314
gem 'vlad', '~> 2.7'
1415
gem 'vlad-git', '~> 2.1'
15-
gem 'listen', '~> 3.10.0' # Preserve ability to run on Ruby 2.0, since listen 3.1 requires Ruby ~> 2.2.
1616
end
1717

1818
group(:generate_references) do
19-
gem 'yard', '~> 0.9'
20-
gem 'rdoc', '~> 7.1'
21-
gem 'rgen', '~> 0.8'
22-
gem 'pandoc-ruby'
23-
gem 'openvox-strings'
24-
gem 'openvox', '~> 8'
2519
gem 'nokogiri', '>= 1.18.9'
20+
gem 'openvox', '~> 8'
21+
gem 'openvox-strings'
22+
gem 'pandoc-ruby'
2623
gem 'pragmatic_segmenter', '~> 0.3'
2724
gem 'punkt-segmenter', '~> 0.9'
25+
gem 'rdoc', '~> 7.1'
26+
gem 'rgen', '~> 0.8'
27+
gem 'yard', '~> 0.9'
2828
end
2929

3030
group(:unknown) do
31-
gem 'maruku', '~> 0.7'
3231
gem 'activerecord', '>= 7.1.5.2'
32+
gem 'maruku', '~> 0.7'
33+
end
34+
35+
group(:development) do
36+
gem 'voxpupuli-rubocop', '~> 5.1.0'
3337
end
3438

3539
# group(:debug) do

0 commit comments

Comments
 (0)