File tree Expand file tree Collapse file tree 3 files changed +46
-5
lines changed Expand file tree Collapse file tree 3 files changed +46
-5
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,26 @@ RuboCop::RakeTask.new do |task|
63
63
end
64
64
` ` `
65
65
66
+ # # RuboCop Rails configuration
67
+
68
+ The following settings specific to RuboCop Rails can be configured in `.rubocop.yml`.
69
+
70
+ # ## `AllCops: TargetRailsVersion`
71
+
72
+ What version of Rails is the inspected code using? If a value is specified
73
+ for `TargetRailsVersion` then it is used. Acceptable values are specified
74
+ as a float (e.g., 7.2); the patch version of Rails should not be included.
75
+
76
+ ` ` ` yaml
77
+ AllCops:
78
+ TargetRailsVersion: 7.2
79
+ ` ` `
80
+
81
+ If `TargetRailsVersion` is not set, RuboCop will parse the Gemfile.lock or
82
+ gems.locked file to find the version of Rails that has been bound to the
83
+ application. If neither of those files exist, RuboCop will use Rails 5.0
84
+ as the default.
85
+
66
86
# # Rails configuration tip
67
87
68
88
In Rails 6.1+, add the following `config.generators.after_generate` setting to
Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ AllCops:
17
17
# Enable checking Active Support extensions.
18
18
# See: https://docs.rubocop.org/rubocop/configuration.html#enable-checking-active-support-extensions
19
19
ActiveSupportExtensionsEnabled : true
20
- # What version of Rails is the inspected code using? If a value is specified
21
- # for TargetRailsVersion then it is used. Acceptable values are specified
22
- # as a float (i.e. 5.1 ); the patch version of Rails should not be included.
23
- # If TargetRailsVersion is not set, RuboCop will parse the Gemfile.lock or
20
+ # What version of Rails is the inspected code using? If a value is specified
21
+ # for ` TargetRailsVersion` then it is used. Acceptable values are specified
22
+ # as a float (e.g., 7.2 ); the patch version of Rails should not be included.
23
+ # If ` TargetRailsVersion` is not set, RuboCop will parse the Gemfile.lock or
24
24
# gems.locked file to find the version of Rails that has been bound to the
25
- # application. If neither of those files exist, RuboCop will use Rails 5.0
25
+ # application. If neither of those files exist, RuboCop will use Rails 5.0
26
26
# as the default.
27
27
TargetRailsVersion : ~
28
28
Original file line number Diff line number Diff line change @@ -31,6 +31,27 @@ RuboCop::RakeTask.new do |task|
31
31
end
32
32
----
33
33
34
+ == RuboCop Rails configuration
35
+
36
+ The following settings specific to RuboCop Rails can be configured in `.rubocop.yml`.
37
+
38
+ === `AllCops: TargetRailsVersion`
39
+
40
+ What version of Rails is the inspected code using? If a value is specified
41
+ for `TargetRailsVersion` then it is used. Acceptable values are specified
42
+ as a float (e.g., 7.2); the patch version of Rails should not be included.
43
+
44
+ [source,yaml]
45
+ ----
46
+ AllCops:
47
+ TargetRailsVersion: 7.2
48
+ ----
49
+
50
+ If `TargetRailsVersion` is not set, RuboCop will parse the Gemfile.lock or
51
+ gems.locked file to find the version of Rails that has been bound to the
52
+ application. If neither of those files exist, RuboCop will use Rails 5.0
53
+ as the default.
54
+
34
55
== Rails configuration tip
35
56
36
57
In Rails 6.1+, add the following `config.generators.after_generate` setting to
You can’t perform that action at this time.
0 commit comments