@@ -13,6 +13,20 @@ module RSpec
13
13
# `OnlyStaticConstants` is only relevant when `EnforcedStyle` is
14
14
# `described_class`.
15
15
#
16
+ # There's a known caveat with rspec-rails's `controller` helper that
17
+ # runs its block in a different context, and `described_class` is not
18
+ # available to it. `SkipBlocks` option excludes detection in all
19
+ # non-RSpec related blocks.
20
+ #
21
+ # To narrow down this setting to only a specific directory, it is
22
+ # possible to use an overriding configuration file local to that
23
+ # directory.
24
+ #
25
+ # @safety
26
+ # Autocorrection is unsafe when `SkipBlocks: false` because
27
+ # `described_class` might not be available within the block (for
28
+ # example, in rspec-rails's `controller` helper).
29
+ #
16
30
# @example `EnforcedStyle: described_class` (default)
17
31
# # bad
18
32
# describe MyClass do
@@ -47,15 +61,6 @@ module RSpec
47
61
# subject { MyClass.do_something }
48
62
# end
49
63
#
50
- # There's a known caveat with rspec-rails's `controller` helper that
51
- # runs its block in a different context, and `described_class` is not
52
- # available to it. `SkipBlocks` option excludes detection in all
53
- # non-RSpec related blocks.
54
- #
55
- # To narrow down this setting to only a specific directory, it is
56
- # possible to use an overriding configuration file local to that
57
- # directory.
58
- #
59
64
# @example `SkipBlocks: true`
60
65
# # spec/controllers/.rubocop.yml
61
66
# # RSpec/DescribedClass:
0 commit comments