docquet 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +20 -0
  3. data/LICENSE +21 -0
  4. data/README.md +205 -0
  5. data/config/cops/bundler.yml +19 -0
  6. data/config/cops/capybara.yml +1 -0
  7. data/config/cops/capybara_rspec.yml +1 -0
  8. data/config/cops/gemspec.yml +4 -0
  9. data/config/cops/i18n_gettext.yml +2 -0
  10. data/config/cops/i18n_railsi18n.yml +1 -0
  11. data/config/cops/layout.yml +79 -0
  12. data/config/cops/lint.yml +7 -0
  13. data/config/cops/metrics.yml +14 -0
  14. data/config/cops/migration.yml +2 -0
  15. data/config/cops/naming.yml +4 -0
  16. data/config/cops/performance.yml +7 -0
  17. data/config/cops/rake.yml +5 -0
  18. data/config/cops/rspec.yml +41 -0
  19. data/config/cops/security.yml +1 -0
  20. data/config/cops/sequel.yml +2 -0
  21. data/config/cops/style.yml +153 -0
  22. data/config/cops/thread_safety.yml +5 -0
  23. data/config/defaults/bundler.yml +97 -0
  24. data/config/defaults/capybara.yml +103 -0
  25. data/config/defaults/capybara_rspec.yml +24 -0
  26. data/config/defaults/gemspec.yml +121 -0
  27. data/config/defaults/i18n_gettext.yml +20 -0
  28. data/config/defaults/i18n_railsi18n.yml +9 -0
  29. data/config/defaults/layout.yml +1121 -0
  30. data/config/defaults/lint.yml +1315 -0
  31. data/config/defaults/metrics.yml +119 -0
  32. data/config/defaults/migration.yml +9 -0
  33. data/config/defaults/naming.yml +332 -0
  34. data/config/defaults/performance.yml +445 -0
  35. data/config/defaults/rake.yml +34 -0
  36. data/config/defaults/rspec.yml +1081 -0
  37. data/config/defaults/security.yml +67 -0
  38. data/config/defaults/sequel.yml +59 -0
  39. data/config/defaults/style.yml +2985 -0
  40. data/config/defaults/thread_safety.yml +45 -0
  41. data/exe/docquet +7 -0
  42. data/lib/docquet/cli/base.rb +21 -0
  43. data/lib/docquet/cli/install_config.rb +75 -0
  44. data/lib/docquet/cli/regenerate_todo.rb +46 -0
  45. data/lib/docquet/cli.rb +6 -0
  46. data/lib/docquet/commands.rb +12 -0
  47. data/lib/docquet/config_processor.rb +52 -0
  48. data/lib/docquet/generators/rubocop_yml_generator.rb +78 -0
  49. data/lib/docquet/inflector.rb +22 -0
  50. data/lib/docquet/plugin_detector.rb +29 -0
  51. data/lib/docquet/rake_task.rb +126 -0
  52. data/lib/docquet/version.rb +6 -0
  53. data/lib/docquet.rb +17 -0
  54. data/templates/rubocop.yml.erb +35 -0
  55. metadata +172 -0
@@ -0,0 +1,119 @@
1
+ # Department 'Metrics' (10):
2
+ # https://docs.rubocop.org/rubocop/cops_metrics.html#metricsabcsize
3
+ Metrics/AbcSize:
4
+ Description: A calculated magnitude based on number of assignments, branches, and
5
+ conditions.
6
+ References:
7
+ - https://wiki.c2.com/?AbcMetric
8
+ - https://en.wikipedia.org/wiki/ABC_Software_Metric
9
+ Enabled: true
10
+ VersionAdded: '0.27'
11
+ VersionChanged: '1.5'
12
+ AllowedMethods: []
13
+ AllowedPatterns: []
14
+ CountRepeatedAttributes: true
15
+ Max: 17
16
+
17
+ # https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocklength
18
+ Metrics/BlockLength:
19
+ Description: Avoid long blocks with many lines.
20
+ Enabled: true
21
+ VersionAdded: '0.44'
22
+ VersionChanged: '1.5'
23
+ CountComments: false
24
+ Max: 25
25
+ CountAsOne: []
26
+ AllowedMethods:
27
+ - refine
28
+ AllowedPatterns: []
29
+ Exclude:
30
+ - "**/*.gemspec"
31
+ - "**/*_spec.rb"
32
+ - "**/spec/**/*"
33
+ inherit_mode:
34
+ merge:
35
+ - Exclude
36
+
37
+ # https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocknesting
38
+ Metrics/BlockNesting:
39
+ Description: Avoid excessive block nesting.
40
+ StyleGuide: "#three-is-the-number-thou-shalt-count"
41
+ Enabled: true
42
+ VersionAdded: '0.25'
43
+ VersionChanged: '1.65'
44
+ CountBlocks: false
45
+ CountModifierForms: false
46
+ Max: 3
47
+
48
+ # https://docs.rubocop.org/rubocop/cops_metrics.html#metricsclasslength
49
+ Metrics/ClassLength:
50
+ Description: Avoid classes longer than 100 lines of code.
51
+ Enabled: true
52
+ VersionAdded: '0.25'
53
+ VersionChanged: '0.87'
54
+ CountComments: false
55
+ Max: 100
56
+ CountAsOne: []
57
+
58
+ # https://docs.rubocop.org/rubocop/cops_metrics.html#metricscollectionliterallength
59
+ Metrics/CollectionLiteralLength:
60
+ Description: Checks for `Array` or `Hash` literals with many entries.
61
+ Enabled: true # was pending
62
+ VersionAdded: '1.47'
63
+ LengthThreshold: 250
64
+
65
+ # https://docs.rubocop.org/rubocop/cops_metrics.html#metricscyclomaticcomplexity
66
+ Metrics/CyclomaticComplexity:
67
+ Description: A complexity metric that is strongly correlated to the number of test
68
+ cases needed to validate a method.
69
+ Enabled: true
70
+ VersionAdded: '0.25'
71
+ VersionChanged: '0.81'
72
+ AllowedMethods: []
73
+ AllowedPatterns: []
74
+ Max: 7
75
+
76
+ # https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmethodlength
77
+ Metrics/MethodLength:
78
+ Description: Avoid methods longer than 10 lines of code.
79
+ StyleGuide: "#short-methods"
80
+ Enabled: true
81
+ VersionAdded: '0.25'
82
+ VersionChanged: '1.5'
83
+ CountComments: false
84
+ Max: 10
85
+ CountAsOne: []
86
+ AllowedMethods: []
87
+ AllowedPatterns: []
88
+
89
+ # https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmodulelength
90
+ Metrics/ModuleLength:
91
+ Description: Avoid modules longer than 100 lines of code.
92
+ Enabled: true
93
+ VersionAdded: '0.31'
94
+ VersionChanged: '0.87'
95
+ CountComments: false
96
+ Max: 100
97
+ CountAsOne: []
98
+
99
+ # https://docs.rubocop.org/rubocop/cops_metrics.html#metricsparameterlists
100
+ Metrics/ParameterLists:
101
+ Description: Avoid parameter lists longer than three or four parameters.
102
+ StyleGuide: "#too-many-params"
103
+ Enabled: true
104
+ VersionAdded: '0.25'
105
+ VersionChanged: '1.5'
106
+ Max: 5
107
+ CountKeywordArgs: true
108
+ MaxOptionalParameters: 3
109
+
110
+ # https://docs.rubocop.org/rubocop/cops_metrics.html#metricsperceivedcomplexity
111
+ Metrics/PerceivedComplexity:
112
+ Description: A complexity metric geared towards measuring complexity for a human reader.
113
+ Enabled: true
114
+ VersionAdded: '0.25'
115
+ VersionChanged: '0.81'
116
+ AllowedMethods: []
117
+ AllowedPatterns: []
118
+ Max: 8
119
+
@@ -0,0 +1,9 @@
1
+ # Department 'Migration' (1):
2
+ # Supports --autocorrect
3
+ # https://docs.rubocop.org/rubocop/cops_migration.html#migrationdepartmentname
4
+ Migration/DepartmentName:
5
+ Description: Check that cop names in rubocop:disable (etc) comments are given with
6
+ department name.
7
+ Enabled: true
8
+ VersionAdded: '0.75'
9
+
@@ -0,0 +1,332 @@
1
+ # Department 'Naming' (19):
2
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingaccessormethodname
3
+ Naming/AccessorMethodName:
4
+ Description: Checks the naming of accessor methods for get_/set_.
5
+ StyleGuide: "#accessor_mutator_method_names"
6
+ Enabled: true
7
+ VersionAdded: '0.50'
8
+
9
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingasciiidentifiers
10
+ Naming/AsciiIdentifiers:
11
+ Description: Use only ascii symbols in identifiers and constants.
12
+ StyleGuide: "#english-identifiers"
13
+ Enabled: true
14
+ VersionAdded: '0.50'
15
+ VersionChanged: '0.87'
16
+ AsciiConstants: true
17
+
18
+ # Supports --autocorrect
19
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingbinaryoperatorparametername
20
+ Naming/BinaryOperatorParameterName:
21
+ Description: When defining binary operators, name the argument other.
22
+ StyleGuide: "#other-arg"
23
+ Enabled: true
24
+ VersionAdded: '0.50'
25
+ VersionChanged: '1.2'
26
+
27
+ # Supports --autocorrect
28
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingblockforwarding
29
+ Naming/BlockForwarding:
30
+ Description: Use anonymous block forwarding.
31
+ StyleGuide: "#block-forwarding"
32
+ Enabled: true # was pending
33
+ VersionAdded: '1.24'
34
+ EnforcedStyle: anonymous
35
+ SupportedStyles:
36
+ - anonymous
37
+ - explicit
38
+ BlockForwardingName: block
39
+
40
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingblockparametername
41
+ Naming/BlockParameterName:
42
+ Description: Checks for block parameter names that contain capital letters, end in
43
+ numbers, or do not meet a minimal length.
44
+ Enabled: true
45
+ VersionAdded: '0.53'
46
+ VersionChanged: '0.77'
47
+ MinNameLength: 1
48
+ AllowNamesEndingInNumbers: true
49
+ AllowedNames: []
50
+ ForbiddenNames: []
51
+
52
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingclassandmodulecamelcase
53
+ Naming/ClassAndModuleCamelCase:
54
+ Description: Use CamelCase for classes and modules.
55
+ StyleGuide: "#camelcase-classes"
56
+ Enabled: true
57
+ VersionAdded: '0.50'
58
+ VersionChanged: '0.85'
59
+ AllowedNames:
60
+ - module_parent
61
+
62
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingconstantname
63
+ Naming/ConstantName:
64
+ Description: Constants should use SCREAMING_SNAKE_CASE.
65
+ StyleGuide: "#screaming-snake-case"
66
+ Enabled: true
67
+ VersionAdded: '0.50'
68
+
69
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingfilename
70
+ Naming/FileName:
71
+ Description: Use snake_case for source file names.
72
+ StyleGuide: "#snake-case-files"
73
+ Enabled: true
74
+ VersionAdded: '0.50'
75
+ VersionChanged: '1.23'
76
+ Exclude:
77
+ - "Rakefile.rb"
78
+ ExpectMatchingDefinition: false
79
+ CheckDefinitionPathHierarchy: true
80
+ CheckDefinitionPathHierarchyRoots:
81
+ - lib
82
+ - spec
83
+ - test
84
+ - src
85
+ Regex:
86
+ IgnoreExecutableScripts: true
87
+ AllowedAcronyms:
88
+ - CLI
89
+ - DSL
90
+ - ACL
91
+ - API
92
+ - ASCII
93
+ - CPU
94
+ - CSS
95
+ - DNS
96
+ - EOF
97
+ - GUID
98
+ - HTML
99
+ - HTTP
100
+ - HTTPS
101
+ - ID
102
+ - IP
103
+ - JSON
104
+ - LHS
105
+ - QPS
106
+ - RAM
107
+ - RHS
108
+ - RPC
109
+ - SLA
110
+ - SMTP
111
+ - SQL
112
+ - SSH
113
+ - TCP
114
+ - TLS
115
+ - TTL
116
+ - UDP
117
+ - UI
118
+ - UID
119
+ - UUID
120
+ - URI
121
+ - URL
122
+ - UTF8
123
+ - VM
124
+ - XML
125
+ - XMPP
126
+ - XSRF
127
+ - XSS
128
+
129
+ # Supports --autocorrect
130
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingheredocdelimitercase
131
+ Naming/HeredocDelimiterCase:
132
+ Description: Use configured case for heredoc delimiters.
133
+ StyleGuide: "#heredoc-delimiters"
134
+ Enabled: true
135
+ VersionAdded: '0.50'
136
+ VersionChanged: '1.2'
137
+ EnforcedStyle: uppercase
138
+ SupportedStyles:
139
+ - lowercase
140
+ - uppercase
141
+
142
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingheredocdelimiternaming
143
+ Naming/HeredocDelimiterNaming:
144
+ Description: Use descriptive heredoc delimiters.
145
+ StyleGuide: "#heredoc-delimiters"
146
+ Enabled: true
147
+ VersionAdded: '0.50'
148
+ ForbiddenDelimiters:
149
+ - !ruby/regexp /(^|\s)(EO[A-Z]{1}|END)(\s|$)/i
150
+
151
+ # Supports --autocorrect
152
+ # https://docs.rubocop.org/rubocop/cops_naming.html#naminginclusivelanguage
153
+ Naming/InclusiveLanguage:
154
+ Description: Recommend the use of inclusive language instead of problematic terms.
155
+ Enabled: true # was false
156
+ VersionAdded: '1.18'
157
+ VersionChanged: '1.49'
158
+ CheckIdentifiers: true
159
+ CheckConstants: true
160
+ CheckVariables: true
161
+ CheckStrings: false
162
+ CheckSymbols: true
163
+ CheckComments: true
164
+ CheckFilepaths: true
165
+ FlaggedTerms:
166
+ whitelist:
167
+ Regex: !ruby/regexp /white[-_\s]?list/
168
+ Suggestions:
169
+ - allowlist
170
+ - permit
171
+ blacklist:
172
+ Regex: !ruby/regexp /black[-_\s]?list/
173
+ Suggestions:
174
+ - denylist
175
+ - block
176
+ slave:
177
+ WholeWord: true
178
+ Suggestions:
179
+ - replica
180
+ - secondary
181
+ - follower
182
+
183
+ # Supports --autocorrect
184
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingmemoizedinstancevariablename
185
+ Naming/MemoizedInstanceVariableName:
186
+ Description: Memoized method name should match memo instance variable name.
187
+ Enabled: true
188
+ VersionAdded: '0.53'
189
+ VersionChanged: '1.2'
190
+ EnforcedStyleForLeadingUnderscores: disallowed
191
+ SupportedStylesForLeadingUnderscores:
192
+ - disallowed
193
+ - required
194
+ - optional
195
+ Safe: false
196
+
197
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingmethodname
198
+ Naming/MethodName:
199
+ Description: Use the configured style when naming methods.
200
+ StyleGuide: "#snake-case-symbols-methods-vars"
201
+ Enabled: true
202
+ VersionAdded: '0.50'
203
+ VersionChanged: '1.75'
204
+ EnforcedStyle: snake_case
205
+ SupportedStyles:
206
+ - snake_case
207
+ - camelCase
208
+ AllowedPatterns: []
209
+ ForbiddenIdentifiers:
210
+ - __id__
211
+ - __send__
212
+ ForbiddenPatterns: []
213
+
214
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingmethodparametername
215
+ Naming/MethodParameterName:
216
+ Description: Checks for method parameter names that contain capital letters, end in
217
+ numbers, or do not meet a minimal length.
218
+ Enabled: true
219
+ VersionAdded: '0.53'
220
+ VersionChanged: '0.77'
221
+ MinNameLength: 3
222
+ AllowNamesEndingInNumbers: true
223
+ AllowedNames:
224
+ - as
225
+ - at
226
+ - by
227
+ - cc
228
+ - db
229
+ - id
230
+ - if
231
+ - in
232
+ - io
233
+ - ip
234
+ - of
235
+ - 'on'
236
+ - os
237
+ - pp
238
+ - to
239
+ ForbiddenNames: []
240
+
241
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingpredicatemethod
242
+ Naming/PredicateMethod:
243
+ Description: Checks that predicate methods end with `?` and non-predicate methods
244
+ do not.
245
+ Enabled: true # was pending
246
+ VersionAdded: '1.76'
247
+ VersionChanged: '1.78'
248
+ Mode: conservative
249
+ AllowedMethods:
250
+ - call
251
+ AllowedPatterns: []
252
+ AllowBangMethods: false
253
+ WaywardPredicates:
254
+ - nonzero?
255
+
256
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingpredicateprefix
257
+ Naming/PredicatePrefix:
258
+ Description: Predicate method names should not be prefixed and end with a `?`.
259
+ StyleGuide: "#bool-methods-qmark"
260
+ Enabled: true
261
+ VersionAdded: '0.50'
262
+ VersionChanged: '1.75'
263
+ NamePrefix:
264
+ - is_
265
+ - has_
266
+ - have_
267
+ - does_
268
+ ForbiddenPrefixes:
269
+ - is_
270
+ - has_
271
+ - have_
272
+ - does_
273
+ AllowedMethods:
274
+ - is_a?
275
+ MethodDefinitionMacros:
276
+ - define_method
277
+ - define_singleton_method
278
+ UseSorbetSigs: false
279
+ Exclude:
280
+ - "spec/**/*"
281
+
282
+ # Supports --autocorrect
283
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingrescuedexceptionsvariablename
284
+ Naming/RescuedExceptionsVariableName:
285
+ Description: Use consistent rescued exceptions variables naming.
286
+ Enabled: true
287
+ VersionAdded: '0.67'
288
+ VersionChanged: '0.68'
289
+ PreferredName: e
290
+
291
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingvariablename
292
+ Naming/VariableName:
293
+ Description: Use the configured style when naming variables.
294
+ StyleGuide: "#snake-case-symbols-methods-vars"
295
+ Enabled: true
296
+ VersionAdded: '0.50'
297
+ VersionChanged: '1.73'
298
+ EnforcedStyle: snake_case
299
+ SupportedStyles:
300
+ - snake_case
301
+ - camelCase
302
+ AllowedIdentifiers: []
303
+ AllowedPatterns: []
304
+ ForbiddenIdentifiers: []
305
+ ForbiddenPatterns: []
306
+
307
+ # https://docs.rubocop.org/rubocop/cops_naming.html#namingvariablenumber
308
+ Naming/VariableNumber:
309
+ Description: Use the configured style when numbering symbols, methods and variables.
310
+ StyleGuide: "#snake-case-symbols-methods-vars-with-numbers"
311
+ Enabled: true
312
+ VersionAdded: '0.50'
313
+ VersionChanged: '1.4'
314
+ EnforcedStyle: normalcase
315
+ SupportedStyles:
316
+ - snake_case
317
+ - normalcase
318
+ - non_integer
319
+ CheckMethodNames: true
320
+ CheckSymbols: true
321
+ AllowedIdentifiers:
322
+ - TLS1_1
323
+ - TLS1_2
324
+ - capture3
325
+ - iso8601
326
+ - rfc1123_date
327
+ - rfc822
328
+ - rfc2822
329
+ - rfc3339
330
+ - x86_64
331
+ AllowedPatterns: []
332
+