rubocop-dev_doc 0.2.0 → 0.3.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 (28) hide show
  1. checksums.yaml +4 -4
  2. data/config/default.yml +230 -61
  3. data/lib/dev_doc/test/best_practice_lints.rb +31 -0
  4. data/lib/dev_doc/test/lints/cron_schedule.rb +345 -0
  5. data/lib/dev_doc/test/lints/duplicate_snapshot.rb +197 -0
  6. data/lib/dev_doc/test/lints/no_file_excludes.rb +128 -0
  7. data/lib/rubocop/cop/dev_doc/auth/current_user_branching.rb +203 -0
  8. data/lib/rubocop/cop/dev_doc/auth/load_resource_current_user_guard.rb +230 -0
  9. data/lib/rubocop/cop/dev_doc/migration/avoid_conditional_schema_changes.rb +89 -0
  10. data/lib/rubocop/cop/dev_doc/migration/avoid_non_null.rb +121 -0
  11. data/lib/rubocop/cop/dev_doc/rails/application_record_transaction.rb +1 -1
  12. data/lib/rubocop/cop/dev_doc/rails/bang_save_in_transaction.rb +127 -0
  13. data/lib/rubocop/cop/dev_doc/rails/enum_column_not_null.rb +99 -0
  14. data/lib/rubocop/cop/dev_doc/rails/enum_must_be_symbolized.rb +2 -2
  15. data/lib/rubocop/cop/dev_doc/rails/no_block_predicate_on_relation.rb +236 -0
  16. data/lib/rubocop/cop/dev_doc/rails/strong_parameters_expect.rb +137 -0
  17. data/lib/rubocop/cop/dev_doc/route/no_custom_actions.rb +171 -0
  18. data/lib/rubocop/cop/dev_doc/route/resource_name_number.rb +77 -0
  19. data/lib/rubocop/cop/dev_doc/style/avoid_send.rb +31 -4
  20. data/lib/rubocop/cop/dev_doc/style/minimize_variable_scope.rb +158 -0
  21. data/lib/rubocop/cop/dev_doc/style/no_unscoped_method_definitions.rb +129 -0
  22. data/lib/rubocop/cop/dev_doc/style/repeated_bracket_read.rb +150 -0
  23. data/lib/rubocop/cop/dev_doc/style/repeated_safe_navigation_receiver.rb +118 -0
  24. data/lib/rubocop/cop/dev_doc/test/avoid_glib_travel_freeze.rb +53 -0
  25. data/lib/rubocop/cop/dev_doc/test/avoid_unit_test.rb +66 -0
  26. data/lib/rubocop/cop/dev_doc/test/response_assert_equal.rb +179 -0
  27. data/lib/rubocop/dev_doc/version.rb +1 -1
  28. metadata +58 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17a792c93018068695bb2c73dc023577864a51cbe29fc8962ba0d82f44784bd5
4
- data.tar.gz: 260d22ceb74db21595f99e912a2bcbc4556718a30de5327fabf562b1174c84aa
3
+ metadata.gz: cd15873d6ee53104760162aa0e5cced9dd69ef1297a70a014dd5643b9404703c
4
+ data.tar.gz: 25d0fa51436912d008625752269ff09ef93e78c14d6d1a941295c6afa47795b4
5
5
  SHA512:
6
- metadata.gz: 6df2aae2a244e306e2a659dfd2f258a5b057fbfa0dda9d6fbc25ef4169fd6c67acc3906e03df78057eb22b4337727c9992ef0bc2b3cd6e760a63edb30dfcfb3b
7
- data.tar.gz: 05b1392296eb25d9625e3f755f2310a262b955ecef1e38d0448d25e6c99352351c5284a9e61a5d3361415e2c2a91e5ae9589fbea532b077babd856a55eb3fa8c
6
+ metadata.gz: 516d5742aa468568e3884d779649164761f982391be0c5f7e5df474d64a933cf71148fe1fddb433c5cf1cd577debd7aadcb16bf22893963d721a3661a1f0fff0
7
+ data.tar.gz: 69a643cf2335d6c7bb365a4a2f8513e9a66d09a6cddb2bec5e44df861ebcb906de51d17fbbd1b591388c651c2f1cb662de5e5a887df7f11db3c9885e9d6ae597
data/config/default.yml CHANGED
@@ -3,88 +3,121 @@
3
3
 
4
4
  # Department-level settings: DocumentationBaseURL lets RuboCop construct per-cop
5
5
  # URLs automatically. DocumentationExtension matches the generated file format.
6
+ DevDoc/Auth:
7
+ DocumentationBaseURL: https://github.com/hgani/dev-doc/blob/main/docs/cops
8
+ DocumentationExtension: ".md"
9
+
6
10
  DevDoc/Migration:
7
11
  DocumentationBaseURL: https://github.com/hgani/dev-doc/blob/main/docs/cops
8
- DocumentationExtension: '.md'
12
+ DocumentationExtension: ".md"
9
13
 
10
14
  DevDoc/Rails:
11
15
  DocumentationBaseURL: https://github.com/hgani/dev-doc/blob/main/docs/cops
12
- DocumentationExtension: '.md'
16
+ DocumentationExtension: ".md"
13
17
 
14
18
  DevDoc/Route:
15
19
  DocumentationBaseURL: https://github.com/hgani/dev-doc/blob/main/docs/cops
16
- DocumentationExtension: '.md'
20
+ DocumentationExtension: ".md"
17
21
 
18
22
  DevDoc/Style:
19
23
  DocumentationBaseURL: https://github.com/hgani/dev-doc/blob/main/docs/cops
20
- DocumentationExtension: '.md'
24
+ DocumentationExtension: ".md"
25
+
26
+ DevDoc/Test:
27
+ DocumentationBaseURL: https://github.com/hgani/dev-doc/blob/main/docs/cops
28
+ DocumentationExtension: ".md"
21
29
 
22
30
  DevDoc/Migration/AvoidJsonColumn:
23
- Description: 'Use `jsonb` instead of `json` for column types.'
31
+ Description: "Use `jsonb` instead of `json` for column types."
24
32
  Enabled: true
25
33
  Include:
26
- - 'db/migrate/*.rb'
27
- - 'db/migrate/**/*.rb'
34
+ - "db/migrate/*.rb"
35
+ - "db/migrate/**/*.rb"
28
36
 
29
37
  DevDoc/Migration/RequireTimestamps:
30
- Description: 'Always include `t.timestamps` in every `create_table` migration.'
38
+ Description: "Always include `t.timestamps` in every `create_table` migration."
31
39
  Enabled: false
32
40
  Include:
33
- - 'db/migrate/*.rb'
34
- - 'db/migrate/**/*.rb'
41
+ - "db/migrate/*.rb"
42
+ - "db/migrate/**/*.rb"
35
43
 
36
44
  DevDoc/Migration/PreferBelongsTo:
37
- Description: 'Use `t.belongs_to` instead of `t.references` for foreign keys.'
45
+ Description: "Use `t.belongs_to` instead of `t.references` for foreign keys."
38
46
  Enabled: true
39
47
  Include:
40
- - 'db/migrate/*.rb'
41
- - 'db/migrate/**/*.rb'
48
+ - "db/migrate/*.rb"
49
+ - "db/migrate/**/*.rb"
42
50
 
43
51
  DevDoc/Migration/AvoidColumnDefault:
44
- Description: 'Avoid setting `default:` in migrations; keep business logic in the application layer.'
52
+ Description: "Avoid setting `default:` in migrations; keep business logic in the application layer."
45
53
  Enabled: true
46
54
  Include:
47
- - 'db/migrate/*.rb'
48
- - 'db/migrate/**/*.rb'
55
+ - "db/migrate/*.rb"
56
+ - "db/migrate/**/*.rb"
57
+
58
+ DevDoc/Migration/AvoidNonNull:
59
+ Description: "Avoid `null: false` on regular columns; keep presence rules in the application layer."
60
+ Enabled: true
61
+ Include:
62
+ - "db/migrate/*.rb"
63
+ - "db/migrate/**/*.rb"
49
64
 
50
65
  # Intentionally global (no Include) — these patterns are risky in any file, not only migrations.
51
66
  # Add project-specific Exclude entries (e.g. db/seeds.rb, lib/tasks/**/*.rb) in your .rubocop.yml
52
67
  # for places where bulk operations are intentional and performance-critical.
53
68
  DevDoc/Migration/AvoidBypassingValidation:
54
- Description: 'Avoid methods that bypass validations and callbacks (`update_column`, `update_all`, `insert_all`, etc.).'
69
+ Description: "Avoid methods that bypass validations and callbacks (`update_column`, `update_all`, `insert_all`, etc.)."
55
70
  Enabled: false
56
71
  Exclude:
57
- - 'spec/**/*'
72
+ - "spec/**/*"
58
73
 
59
74
  DevDoc/Migration/DateColumnNaming:
60
- Description: 'Date columns should end with `_on`; datetime columns should end with `_at`.'
75
+ Description: "Date columns should end with `_on`; datetime columns should end with `_at`."
61
76
  Enabled: true
62
77
  Include:
63
- - 'db/migrate/*.rb'
64
- - 'db/migrate/**/*.rb'
78
+ - "db/migrate/*.rb"
79
+ - "db/migrate/**/*.rb"
65
80
 
66
81
  DevDoc/Migration/AvoidVagueColumnNames:
67
- Description: 'Avoid vague column names like `status` or `group`. Use more specific names.'
82
+ Description: "Avoid vague column names like `status` or `group`. Use more specific names."
68
83
  Enabled: true
69
84
  VagueNames:
70
85
  - status
71
86
  - group
72
87
  Include:
73
- - 'db/migrate/*.rb'
74
- - 'db/migrate/**/*.rb'
88
+ - "db/migrate/*.rb"
89
+ - "db/migrate/**/*.rb"
75
90
 
76
91
  DevDoc/Route/ResourcesRequireOnly:
77
- Description: 'Always use `only:` or `except:` when defining `resources` or `resource` routes.'
92
+ Description: "Always use `only:` or `except:` when defining `resources` or `resource` routes."
78
93
  Enabled: true
79
94
  # RequireOnly: true (default) — only `only:` is accepted; `except:` is flagged.
80
95
  # RequireOnly: false — both `only:` and `except:` are accepted; only the bare form is flagged.
81
96
  RequireOnly: true
82
97
  Include:
83
- - 'config/routes.rb'
84
- - 'config/routes/**/*.rb'
98
+ - "config/routes.rb"
99
+ - "config/routes/**/*.rb"
100
+
101
+ DevDoc/Rails/BangSaveInTransaction:
102
+ Description: "Use bang (`save!`/`update!`/`create!`) inside a `transaction` block, or check the return value."
103
+ Enabled: true
104
+
105
+ DevDoc/Route/NoCustomActions:
106
+ Description: "Avoid custom `member`/`collection` actions; model them as RESTful sub-resources."
107
+ Enabled: true
108
+ Include:
109
+ - "config/routes.rb"
110
+ - "config/routes/**/*.rb"
111
+
112
+ DevDoc/Route/ResourceNameNumber:
113
+ Description: "Use a plural name for `resources` and a singular name for `resource`."
114
+ Enabled: true
115
+ Include:
116
+ - "config/routes.rb"
117
+ - "config/routes/**/*.rb"
85
118
 
86
119
  DevDoc/Rails/NoDeliverLaterInTransaction:
87
- Description: 'Avoid `deliver_later`/`perform_later` inside a `transaction` block; the job may use stale data.'
120
+ Description: "Avoid `deliver_later`/`perform_later` inside a `transaction` block; the job may use stale data."
88
121
  Enabled: true
89
122
  KnownAsyncWrappers:
90
123
  - send_verification_email!
@@ -93,26 +126,62 @@ DevDoc/Rails/NoDeliverLaterInTransaction:
93
126
  - send_unlock_instructions
94
127
 
95
128
  DevDoc/Rails/NoPerformLaterInModel:
96
- Description: 'Avoid `perform_later` inside model files; use explicit methods called from the controller.'
129
+ Description: "Avoid `perform_later` inside model files; use explicit methods called from the controller."
97
130
  Enabled: true
98
131
  Include:
99
- - 'app/models/**/*.rb'
132
+ - "app/models/**/*.rb"
100
133
 
101
134
  DevDoc/Rails/EnumMustBeSymbolized:
102
- Description: 'Pair every `enum :foo` with `enum_symbolize :foo` so the reader returns a symbol.'
135
+ Description: "Pair every `enum :foo` with `enum_symbolize :foo` so the reader returns a symbol."
103
136
  Enabled: true
104
137
  Include:
105
- - 'app/models/**/*.rb'
138
+ - "app/models/**/*.rb"
139
+
140
+ DevDoc/Rails/EnumColumnNotNull:
141
+ Description: "Enum columns must be backed by a `null: false` database column."
142
+ Enabled: true
143
+ Include:
144
+ - "app/models/**/*.rb"
145
+
146
+ DevDoc/Rails/NoBlockPredicateOnRelation:
147
+ Description: "Avoid block-form `count`/`reject`/`select`/`find`/`any?` on AR relations; push the predicate into SQL with `.where(...)` or a scope."
148
+ Enabled: true
149
+ Exclude:
150
+ - "spec/**/*"
151
+ - "test/**/*"
152
+ - "db/seeds.rb"
153
+ - "db/seeds/**/*.rb"
154
+ - "lib/tasks/**/*.rb"
155
+
156
+ DevDoc/Style/NoUnscopedMethodDefinitions:
157
+ Description: "Define methods inside an explicit `module` or `class`; bare `def` outside a class/module body lands on `Object`."
158
+ Enabled: true
159
+ # SafeDSLReceivers: list of constant names whose `.new { }` blocks are safe
160
+ # (methods inside them do NOT land on Object). Struct, Class, Module are
161
+ # included by default.
162
+ SafeDSLReceivers: []
106
163
 
107
164
  DevDoc/Style/AvoidSend:
108
- Description: 'Avoid `send`/`public_send` with an explicit receiver; prefer direct calls or safer alternatives.'
165
+ Description: "Avoid `send`/`public_send` with an explicit receiver; prefer direct calls or safer alternatives."
166
+ Enabled: true
167
+
168
+ DevDoc/Style/RepeatedSafeNavigationReceiver:
169
+ Description: "Avoid using `&.` on the same receiver more than once in a method body — assign once and use `.` after."
170
+ Enabled: true
171
+
172
+ DevDoc/Style/RepeatedBracketRead:
173
+ Description: "Avoid reading `obj[key]` more than once with the same receiver and key in a method body — assign once and reuse."
174
+ Enabled: true
175
+
176
+ DevDoc/Style/MinimizeVariableScope:
177
+ Description: "Assign a variable inside the `if` condition that guards it, to keep its scope local to the branch."
109
178
  Enabled: true
110
179
 
111
180
  DevDoc/Style/AvoidHeadResponse:
112
- Description: 'Avoid `head()` with error statuses; delegate error handling to Rails exceptions or model validations.'
181
+ Description: "Avoid `head()` with error statuses; delegate error handling to Rails exceptions or model validations."
113
182
  Enabled: true
114
183
  Include:
115
- - 'app/controllers/**/*.rb'
184
+ - "app/controllers/**/*.rb"
116
185
  FlaggedStatuses:
117
186
  - not_found
118
187
  - unprocessable_entity
@@ -122,34 +191,41 @@ DevDoc/Style/AvoidHeadResponse:
122
191
  - conflict
123
192
  - gone
124
193
  - method_not_allowed
125
- - '404'
126
- - '422'
127
- - '403'
128
- - '401'
129
- - '400'
130
- - '409'
131
- - '410'
132
- - '405'
194
+ - "404"
195
+ - "422"
196
+ - "403"
197
+ - "401"
198
+ - "400"
199
+ - "409"
200
+ - "410"
201
+ - "405"
202
+
203
+ DevDoc/Migration/AvoidConditionalSchemaChanges:
204
+ Description: "Avoid conditional schema helpers (`add_column_if_not_exists`, `column_exists?`, etc.) in migrations."
205
+ Enabled: true
206
+ Include:
207
+ - "db/migrate/*.rb"
208
+ - "db/migrate/**/*.rb"
133
209
 
134
210
  DevDoc/Migration/RequirePrimaryKey:
135
- Description: 'Every `create_table` must have a primary key. Avoid `id: false`.'
211
+ Description: "Every `create_table` must have a primary key. Avoid `id: false`."
136
212
  Enabled: true
137
213
  Include:
138
- - 'db/migrate/*.rb'
139
- - 'db/migrate/**/*.rb'
214
+ - "db/migrate/*.rb"
215
+ - "db/migrate/**/*.rb"
140
216
 
141
217
  DevDoc/Migration/NoCreateJoinTable:
142
- Description: 'Avoid `create_join_table` — define an explicit join model with `has_many :through` instead.'
218
+ Description: "Avoid `create_join_table` — define an explicit join model with `has_many :through` instead."
143
219
  Enabled: true
144
220
  Include:
145
- - 'db/migrate/*.rb'
146
- - 'db/migrate/**/*.rb'
221
+ - "db/migrate/*.rb"
222
+ - "db/migrate/**/*.rb"
147
223
 
148
224
  # This cop is heuristic: it matches column names whose last segment is a known
149
225
  # monetary word. Enable it in your project's .rubocop.yml and extend MonetaryNames
150
226
  # if your domain uses different names. Disabled by default to avoid false positives.
151
227
  DevDoc/Migration/AmountColumnInCents:
152
- Description: 'Monetary columns must be stored as integer cents with an `_in_cents` suffix.'
228
+ Description: "Monetary columns must be stored as integer cents with an `_in_cents` suffix."
153
229
  Enabled: false
154
230
  MonetaryNames:
155
231
  - amount
@@ -162,36 +238,129 @@ DevDoc/Migration/AmountColumnInCents:
162
238
  - discount
163
239
  - tax
164
240
  Include:
165
- - 'db/migrate/*.rb'
166
- - 'db/migrate/**/*.rb'
241
+ - "db/migrate/*.rb"
242
+ - "db/migrate/**/*.rb"
167
243
 
168
244
  DevDoc/Rails/AvoidRailsCallbacks:
169
- Description: 'Avoid Rails callback DSL (`after_create`, `before_save`, etc.) — use explicit methods instead.'
245
+ Description: "Avoid Rails callback DSL (`after_create`, `before_save`, etc.) — use explicit methods instead."
170
246
  Enabled: true
171
247
  Include:
172
- - 'app/models/**/*.rb'
248
+ - "app/models/**/*.rb"
173
249
 
174
250
  DevDoc/Rails/ApplicationRecordTransaction:
175
- Description: 'Use `ApplicationRecord.transaction` instead of `SomeModel.transaction` outside model files.'
251
+ Description: "Use `ApplicationRecord.transaction` instead of `SomeModel.transaction` outside model files."
176
252
  Enabled: true
177
253
  Exclude:
178
- - 'app/models/**/*.rb'
254
+ - "app/models/**/*.rb"
179
255
 
180
256
  DevDoc/Style/AvoidOptionsHash:
181
- Description: 'Use keyword arguments instead of `**options` — typos raise `ArgumentError`; options hashes swallow them silently.'
257
+ Description: "Use keyword arguments instead of `**options` — typos raise `ArgumentError`; options hashes swallow them silently."
182
258
  Enabled: true
183
259
 
184
260
  DevDoc/Style/StringSymbolComparison:
185
- Description: 'Comparing a known-string source (params, request.headers, ENV) to a symbol literal is always false.'
261
+ Description: "Comparing a known-string source (params, request.headers, ENV) to a symbol literal is always false."
262
+ Enabled: true
263
+
264
+ DevDoc/Test/ResponseAssertEqual:
265
+ Description: "Controller tests that assert on `response.body` should also snapshot the full response with `response_assert_equal`."
266
+ # Enabled by default. A project adopting the gem with an existing backlog will
267
+ # see offenses immediately — fix them (preferred) or inline-`disable` the few
268
+ # that genuinely can't snapshot (non-JSON / non-deterministic responses).
186
269
  Enabled: true
270
+ Include:
271
+ - "test/controllers/**/*_test.rb"
187
272
 
188
273
  Rails/CreateTableWithTimestamps:
189
274
  Enabled: true
190
275
  Include:
191
- - 'db/migrate/*.rb'
192
- - 'db/migrate/**/*.rb'
276
+ - "db/migrate/*.rb"
277
+ - "db/migrate/**/*.rb"
193
278
 
194
279
  Rails/SkipsModelValidations:
195
280
  Enabled: true
196
281
  Exclude:
197
- - 'spec/**/*'
282
+ - "spec/**/*"
283
+
284
+ # Upstream cop stays off — its scalar-form autocorrect produces false positives
285
+ # on optional query params (e.g. `params[:status]&.to_sym || :draft`).
286
+ # Our narrower replacement below flags only the hash-form rewrite.
287
+ Rails/StrongParametersExpect:
288
+ Enabled: false
289
+
290
+ # Narrower replacement for Rails/StrongParametersExpect — flags only the
291
+ # hash-form rewrite (`params.require(:foo).permit(...)` → `params.expect(foo: [...])`).
292
+ # Does not flag scalar `params[:foo]` in any context.
293
+ DevDoc/Rails/StrongParametersExpect:
294
+ Description: "Use `params.expect(foo: [...])` instead of `params.require(:foo).permit(...)`."
295
+ Enabled: true
296
+ Include:
297
+ - "app/controllers/**/*.rb"
298
+
299
+ # `save!` / `update!` raise on persistence failure, which is what
300
+ # we want in jobs/services/rake tasks — silent `false` returns
301
+ # hide bugs. Excluded for controllers, which lean on `save`
302
+ # returning false so `json_model_response` (and similar) can
303
+ # render the form with errors instead of crashing to 500.
304
+ Rails/SaveBang:
305
+ Enabled: true
306
+ Exclude:
307
+ - "app/controllers/**/*"
308
+
309
+ Style/MissingElse:
310
+ Enabled: true
311
+ EnforcedStyle: case
312
+
313
+ # Core default is `Max: 2`, which permits `a&.b&.c`. Tightened to `Max: 1`:
314
+ # in `a&.b&.c`, the second `&.` is ambiguous — the reader can't tell whether
315
+ # it's there because `b.c` can genuinely be nil on its own, or merely because
316
+ # the first `&.` already short-circuits the chain when `a` is nil. Splitting
317
+ # the chain (`if (b = a&.b); b.c; end`) makes each nullable source explicit.
318
+ # See best_practices/backend/en/01a_defensive_programming.md #4.
319
+ Style/SafeNavigationChainLength:
320
+ Enabled: true
321
+ Max: 1
322
+
323
+ # `has_X?` reads more naturally than the cop's preferred `X?` in many cases —
324
+ # `has_active_subscription?` vs `active_subscription?`, `has_assignee?(member)`
325
+ # vs `assignee?(member)`. Disabled cross-project so individual `.rubocop.yml`
326
+ # files don't have to repeat the same decision.
327
+ DevDoc/Test/AvoidGlibTravelFreeze:
328
+ Description: "Avoid `glib_travel_freeze` in test files — use `glib_travel` instead."
329
+ Enabled: true
330
+ Include:
331
+ - "test/**/*.rb"
332
+ - "spec/**/*.rb"
333
+
334
+ DevDoc/Test/AvoidUnitTest:
335
+ Description: "Prefer controller tests; unit tests (`< ActiveSupport::TestCase`) are a rare, justified exception."
336
+ Enabled: true
337
+ Include:
338
+ - "test/**/*.rb"
339
+ - "spec/**/*.rb"
340
+
341
+ Naming/PredicatePrefix:
342
+ Enabled: false
343
+
344
+ # Enforces that every `has_many` / `has_one` declares a `dependent:` option.
345
+ # Aligns with best_practices/backend/en/03_model.md #1 which prescribes
346
+ # `dependent: :restrict_with_exception` as the default.
347
+ Rails/HasManyOrHasOneDependent:
348
+ Enabled: true
349
+
350
+ DevDoc/Auth/LoadResourceCurrentUserGuard:
351
+ Description: "Require a `return unless current_user` guard before using `current_user` inside `glib_load_resource`, and forbid `current_user&.`."
352
+ Enabled: true
353
+ # LoadResourceMethodNames: list of method names where the guard rule applies.
354
+ # Extend if your project uses a different lifecycle hook name.
355
+ LoadResourceMethodNames:
356
+ - glib_load_resource
357
+
358
+ DevDoc/Auth/CurrentUserBranching:
359
+ Description: "Avoid branching on `current_user` / `user_signed_in?` in page-specific code. Use shared layouts or an inline disable with a reason for genuinely dual-state pages."
360
+ Enabled: true
361
+ Exclude:
362
+ - "app/policies/**/*.rb"
363
+ - "app/helpers/**/*.rb"
364
+ - "app/controllers/concerns/**/*.rb"
365
+ - "app/views/layouts/**/*"
366
+ - "app/controllers/application_controller.rb"
@@ -0,0 +1,31 @@
1
+ require_relative 'lints/cron_schedule'
2
+ require_relative 'lints/duplicate_snapshot'
3
+ require_relative 'lints/no_file_excludes'
4
+
5
+ module DevDoc
6
+ module Test
7
+ # Aggregator that pulls in every dev-doc best-practice lint as a set of
8
+ # Minitest `test_*` methods. Include this in a single test class in
9
+ # each project; new lints added here automatically apply to all
10
+ # consuming projects on the next `bundle update`.
11
+ #
12
+ # Per-project integration (one file, never needs editing):
13
+ #
14
+ # # test/linters/best_practice_lints_test.rb
15
+ # require 'dev_doc/test/best_practice_lints'
16
+ #
17
+ # class BestPracticeLintsTest < ActiveSupport::TestCase
18
+ # include DevDoc::Test::BestPracticeLints
19
+ # end
20
+ #
21
+ # To opt out of a specific lint in a project, redefine the offending
22
+ # `test_*` method in that test class as a `skip 'reason'`.
23
+ module BestPracticeLints
24
+ def self.included(base)
25
+ base.include Lints::CronSchedule
26
+ base.include Lints::DuplicateSnapshot
27
+ base.include Lints::NoFileExcludes
28
+ end
29
+ end
30
+ end
31
+ end