rubocop-discourse 3.13.3 → 3.14.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.
- checksums.yaml +4 -4
- data/README.md +35 -3
- data/lib/rubocop/cop/discourse/plugins/call_requires_plugin.rb +1 -2
- data/lib/rubocop/cop/discourse/plugins/no_monkey_patching.rb +5 -12
- data/lib/rubocop/cop/discourse/plugins/use_plugin_instance_on.rb +1 -2
- data/lib/rubocop/cop/discourse/services/empty_lines_around_blocks.rb +6 -12
- data/lib/rubocop/cop/discourse/services/group_keywords.rb +2 -7
- data/lib/rubocop/discourse/version.rb +1 -1
- data/rubocop-core.yml +2 -143
- data/rubocop-discourse.gemspec +15 -2
- data/rubocop-layout.yml +2 -80
- data/rubocop-rspec.yml +9 -215
- metadata +5 -35
- data/.github/workflows/ci.yml +0 -41
- data/.gitignore +0 -1
- data/.rspec +0 -1
- data/.rubocop.yml +0 -9
- data/.streerc +0 -2
- data/Gemfile +0 -11
- data/Rakefile +0 -8
- data/spec/fixtures/controllers/bad_controller.rb +0 -5
- data/spec/fixtures/controllers/base_controller.rb +0 -11
- data/spec/fixtures/controllers/good_controller.rb +0 -4
- data/spec/fixtures/controllers/inherit_from_outside_controller.rb +0 -5
- data/spec/fixtures/controllers/namespaced_parent_controller.rb +0 -5
- data/spec/fixtures/controllers/no_requires_plugin_controller.rb +0 -5
- data/spec/fixtures/controllers/requires_plugin_controller.rb +0 -6
- data/spec/lib/rubocop/cop/discourse/services/empty_lines_around_blocks_spec.rb +0 -309
- data/spec/lib/rubocop/cop/discourse/services/group_keywords_spec.rb +0 -137
- data/spec/lib/rubocop/cop/fabricator_shorthand_spec.rb +0 -71
- data/spec/lib/rubocop/cop/no_add_reference_active_record_migrations_spec.rb +0 -47
- data/spec/lib/rubocop/cop/no_mixing_multisite_and_standard_specs_spec.rb +0 -68
- data/spec/lib/rubocop/cop/no_mocking_jobs_enqueue_spec.rb +0 -31
- data/spec/lib/rubocop/cop/no_reset_column_information_migrations_spec.rb +0 -33
- data/spec/lib/rubocop/cop/only_top_level_multisite_specs_spec.rb +0 -78
- data/spec/lib/rubocop/cop/plugins/call_requires_plugin_spec.rb +0 -79
- data/spec/lib/rubocop/cop/plugins/namespace_constants_spec.rb +0 -40
- data/spec/lib/rubocop/cop/plugins/namespace_methods_spec.rb +0 -84
- data/spec/lib/rubocop/cop/plugins/no_monkey_patching_spec.rb +0 -91
- data/spec/lib/rubocop/cop/plugins/use_plugin_instance_on_spec.rb +0 -37
- data/spec/lib/rubocop/cop/plugins/use_require_relative_spec.rb +0 -24
- data/spec/lib/rubocop/cop/time_eq_matcher_spec.rb +0 -23
- data/spec/spec_helper.rb +0 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e722863ce072ee0a4d928e09b36a1e12e3b653618fdc0fe70a2f417d466e0ffa
|
|
4
|
+
data.tar.gz: bd4a868a26bd7df10e3196c9d9c419f1b4268051d6302b335994eb539ae6e61e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0e266174ecceb19102b630bdb01419b0b22580fcadaf5cc5f69a3ba7c7c91a6274ff391a7cf43769c71cb035699e1867d96b0c72ba28cd0706335a5821ce3fe4
|
|
7
|
+
data.tar.gz: 3e5d42d6aa34bf2eb23daaf91eef254623cd83fe812525c2bda429cd96e9f3ec0b0d0b19129d3faa5e64e749decf0164f012d99755787559d2e715ec3e16441c
|
data/README.md
CHANGED
|
@@ -1,11 +1,43 @@
|
|
|
1
1
|
# rubocop-discourse
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Custom Discourse RuboCop cops plus our shared project configuration (RSpec, Rails, Capybara, FactoryBot). Most Discourse projects use Syntax Tree for formatting, so we recommend the Syntax Tree-compatible config by default.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add the gem to your development group:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
group :development, :test do
|
|
11
|
+
gem "rubocop-discourse"
|
|
12
|
+
end
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Configuration
|
|
16
|
+
|
|
17
|
+
Recommended (Syntax Tree-friendly, omits Layout cops so it can be used with the formatter):
|
|
18
|
+
|
|
19
|
+
```yml
|
|
20
|
+
inherit_gem:
|
|
21
|
+
rubocop-discourse: stree-compat.yml
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`stree-compat.yml` includes Discourse cops plus core/RSpec/Rails/Capybara/FactoryBot, but leaves layout to Syntax Tree.
|
|
25
|
+
|
|
26
|
+
Base config with layout cops (for projects not using Syntax Tree):
|
|
7
27
|
|
|
8
28
|
```yml
|
|
9
29
|
inherit_gem:
|
|
10
30
|
rubocop-discourse: default.yml
|
|
11
31
|
```
|
|
32
|
+
|
|
33
|
+
`default.yml` is kept for backwards compatibility and pulls in `stree-compat.yml` plus `rubocop-layout.yml`.
|
|
34
|
+
|
|
35
|
+
Then run `bundle exec rubocop` as usual.
|
|
36
|
+
|
|
37
|
+
Switching an existing project to Syntax Tree:
|
|
38
|
+
|
|
39
|
+
```diff
|
|
40
|
+
inherit_gem:
|
|
41
|
+
- rubocop-discourse: default.yml # includes layout cops
|
|
42
|
+
+ rubocop-discourse: stree-compat.yml # defers layout to Syntax Tree
|
|
43
|
+
```
|
|
@@ -44,8 +44,7 @@ module RuboCop
|
|
|
44
44
|
|
|
45
45
|
def requires_plugin_present_in_parent_classes(node)
|
|
46
46
|
return unless processed_source.path
|
|
47
|
-
controller_path =
|
|
48
|
-
base_controller_path(node.parent_class&.const_name.to_s)
|
|
47
|
+
controller_path = base_controller_path(node.parent_class&.const_name.to_s)
|
|
49
48
|
return unless controller_path
|
|
50
49
|
Commissioner
|
|
51
50
|
.new([self.class.new(config, @options)])
|
|
@@ -46,14 +46,11 @@ module RuboCop
|
|
|
46
46
|
# add_to_serializer(:user, :new_method) { do_processing }
|
|
47
47
|
#
|
|
48
48
|
class NoMonkeyPatching < Base
|
|
49
|
-
MSG =
|
|
50
|
-
|
|
51
|
-
MSG_CLASS_EVAL =
|
|
52
|
-
"Don’t call `class_eval`. Instead, create a mixin and use `prepend`."
|
|
49
|
+
MSG = "Don’t reopen existing classes. Instead, create a mixin and use `prepend`."
|
|
50
|
+
MSG_CLASS_EVAL = "Don’t call `class_eval`. Instead, create a mixin and use `prepend`."
|
|
53
51
|
MSG_CLASS_EVAL_SERIALIZERS =
|
|
54
52
|
"Don’t call `class_eval` on a serializer. If you’re adding new methods, use `add_to_serializer`. Otherwise, create a mixin and use `prepend`."
|
|
55
|
-
MSG_SERIALIZERS =
|
|
56
|
-
"Don’t reopen serializers. Instead, use `add_to_serializer`."
|
|
53
|
+
MSG_SERIALIZERS = "Don’t reopen serializers. Instead, use `add_to_serializer`."
|
|
57
54
|
RESTRICT_ON_SEND = [:class_eval].freeze
|
|
58
55
|
|
|
59
56
|
def_node_matcher :existing_class?, <<~MATCHER
|
|
@@ -65,18 +62,14 @@ module RuboCop
|
|
|
65
62
|
MATCHER
|
|
66
63
|
|
|
67
64
|
def on_send(node)
|
|
68
|
-
if serializer?(node)
|
|
69
|
-
return add_offense(node, message: MSG_CLASS_EVAL_SERIALIZERS)
|
|
70
|
-
end
|
|
65
|
+
return add_offense(node, message: MSG_CLASS_EVAL_SERIALIZERS) if serializer?(node)
|
|
71
66
|
add_offense(node, message: MSG_CLASS_EVAL)
|
|
72
67
|
end
|
|
73
68
|
|
|
74
69
|
def on_class(node)
|
|
75
70
|
return unless in_plugin_rb_file?
|
|
76
71
|
return unless existing_class?(node)
|
|
77
|
-
if serializer?(node)
|
|
78
|
-
return add_offense(node, message: MSG_SERIALIZERS)
|
|
79
|
-
end
|
|
72
|
+
return add_offense(node, message: MSG_SERIALIZERS) if serializer?(node)
|
|
80
73
|
add_offense(node, message: MSG)
|
|
81
74
|
end
|
|
82
75
|
|
|
@@ -16,8 +16,7 @@ module RuboCop
|
|
|
16
16
|
class UsePluginInstanceOn < Base
|
|
17
17
|
MSG =
|
|
18
18
|
"Use `on` instead of `DiscourseEvent.on` as the latter will listen to events even if the plugin is disabled."
|
|
19
|
-
NOT_OUTSIDE_PLUGIN_RB =
|
|
20
|
-
"Don’t call `DiscourseEvent.on` outside `plugin.rb`."
|
|
19
|
+
NOT_OUTSIDE_PLUGIN_RB = "Don’t call `DiscourseEvent.on` outside `plugin.rb`."
|
|
21
20
|
RESTRICT_ON_SEND = [:on].freeze
|
|
22
21
|
|
|
23
22
|
def_node_matcher :discourse_event_on?, <<~MATCHER
|
|
@@ -57,18 +57,14 @@ module RuboCop
|
|
|
57
57
|
|
|
58
58
|
if missing_empty_lines?(node)
|
|
59
59
|
add_offense(node, message: MSG) do |corrector|
|
|
60
|
-
if missing_empty_line_before?(node) &&
|
|
61
|
-
corrected_after.exclude?(node.left_sibling)
|
|
60
|
+
if missing_empty_line_before?(node) && corrected_after.exclude?(node.left_sibling)
|
|
62
61
|
corrected_before << node
|
|
63
62
|
corrector.insert_before(
|
|
64
|
-
node.loc.expression.adjust(
|
|
65
|
-
|
|
66
|
-
),
|
|
67
|
-
"\n"
|
|
63
|
+
node.loc.expression.adjust(begin_pos: -node.loc.expression.column),
|
|
64
|
+
"\n",
|
|
68
65
|
)
|
|
69
66
|
end
|
|
70
|
-
if missing_empty_line_after?(node) &&
|
|
71
|
-
corrected_before.exclude?(node.right_sibling)
|
|
67
|
+
if missing_empty_line_after?(node) && corrected_before.exclude?(node.right_sibling)
|
|
72
68
|
corrected_after << node
|
|
73
69
|
corrector.insert_after(node.loc.end, "\n")
|
|
74
70
|
end
|
|
@@ -91,13 +87,11 @@ module RuboCop
|
|
|
91
87
|
end
|
|
92
88
|
|
|
93
89
|
def missing_empty_line_before?(node)
|
|
94
|
-
processed_source[node.loc.expression.line - 2].present? &&
|
|
95
|
-
node.left_siblings.present?
|
|
90
|
+
processed_source[node.loc.expression.line - 2].present? && node.left_siblings.present?
|
|
96
91
|
end
|
|
97
92
|
|
|
98
93
|
def missing_empty_line_after?(node)
|
|
99
|
-
processed_source[node.loc.end.line].present? &&
|
|
100
|
-
node.right_siblings.present?
|
|
94
|
+
processed_source[node.loc.end.line].present? && node.right_siblings.present?
|
|
101
95
|
end
|
|
102
96
|
|
|
103
97
|
def corrected_before
|
|
@@ -46,9 +46,7 @@ module RuboCop
|
|
|
46
46
|
|
|
47
47
|
add_offense(node, message: MSG) do |corrector|
|
|
48
48
|
range =
|
|
49
|
-
node.loc.expression.end.with(
|
|
50
|
-
end_pos: node.right_sibling.loc.expression.begin_pos
|
|
51
|
-
)
|
|
49
|
+
node.loc.expression.end.with(end_pos: node.right_sibling.loc.expression.begin_pos)
|
|
52
50
|
content = range.source.gsub(/^(\n)+/, "\n")
|
|
53
51
|
corrector.replace(range, content)
|
|
54
52
|
end
|
|
@@ -62,10 +60,7 @@ module RuboCop
|
|
|
62
60
|
|
|
63
61
|
def extra_empty_line_after?(node)
|
|
64
62
|
processed_source[node.loc.expression.line].blank? &&
|
|
65
|
-
(
|
|
66
|
-
service_keyword?(node.right_sibling) ||
|
|
67
|
-
single_line_block?(node.right_sibling)
|
|
68
|
-
)
|
|
63
|
+
(service_keyword?(node.right_sibling) || single_line_block?(node.right_sibling))
|
|
69
64
|
end
|
|
70
65
|
|
|
71
66
|
def service_keyword?(node)
|
data/rubocop-core.yml
CHANGED
|
@@ -1,143 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Security/IoMethods:
|
|
5
|
-
Enabled: true
|
|
6
|
-
|
|
7
|
-
Security/CompoundHash:
|
|
8
|
-
Enabled: true
|
|
9
|
-
|
|
10
|
-
# Prefer &&/|| over and/or.
|
|
11
|
-
Style/AndOr:
|
|
12
|
-
Enabled: true
|
|
13
|
-
|
|
14
|
-
Style/FrozenStringLiteralComment:
|
|
15
|
-
Enabled: true
|
|
16
|
-
|
|
17
|
-
# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
|
|
18
|
-
Style/HashSyntax:
|
|
19
|
-
Enabled: true
|
|
20
|
-
EnforcedShorthandSyntax: either
|
|
21
|
-
|
|
22
|
-
# Defining a method with parameters needs parentheses.
|
|
23
|
-
Style/MethodDefParentheses:
|
|
24
|
-
Enabled: true
|
|
25
|
-
|
|
26
|
-
Style/SingleLineMethods:
|
|
27
|
-
Enabled: true
|
|
28
|
-
|
|
29
|
-
Style/Semicolon:
|
|
30
|
-
Enabled: true
|
|
31
|
-
AllowAsExpressionSeparator: true
|
|
32
|
-
|
|
33
|
-
Style/RedundantReturn:
|
|
34
|
-
Enabled: true
|
|
35
|
-
|
|
36
|
-
Style/GlobalVars:
|
|
37
|
-
Enabled: true
|
|
38
|
-
Severity: warning
|
|
39
|
-
Exclude:
|
|
40
|
-
- "lib/tasks/**/*"
|
|
41
|
-
- "script/**/*"
|
|
42
|
-
- "**/spec/**/*"
|
|
43
|
-
|
|
44
|
-
Style/InvertibleUnlessCondition:
|
|
45
|
-
Enabled: true
|
|
46
|
-
|
|
47
|
-
Style/NegatedUnless:
|
|
48
|
-
Enabled: true
|
|
49
|
-
|
|
50
|
-
Style/UnlessElse:
|
|
51
|
-
Enabled: true
|
|
52
|
-
|
|
53
|
-
Style/UnlessLogicalOperators:
|
|
54
|
-
Enabled: true
|
|
55
|
-
|
|
56
|
-
Lint/Debugger:
|
|
57
|
-
Enabled: true
|
|
58
|
-
|
|
59
|
-
# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
|
|
60
|
-
Lint/RequireParentheses:
|
|
61
|
-
Enabled: true
|
|
62
|
-
|
|
63
|
-
Lint/ShadowingOuterLocalVariable:
|
|
64
|
-
Enabled: true
|
|
65
|
-
|
|
66
|
-
Bundler/OrderedGems:
|
|
67
|
-
Enabled: false
|
|
68
|
-
|
|
69
|
-
Layout/LineLength:
|
|
70
|
-
Enabled: false
|
|
71
|
-
|
|
72
|
-
Lint/ParenthesesAsGroupedExpression:
|
|
73
|
-
Enabled: true
|
|
74
|
-
|
|
75
|
-
Lint/DuplicateMethods:
|
|
76
|
-
Enabled: true
|
|
77
|
-
|
|
78
|
-
Lint/RedundantWithIndex:
|
|
79
|
-
Enabled: true
|
|
80
|
-
|
|
81
|
-
Lint/RedundantRequireStatement:
|
|
82
|
-
Enabled: true
|
|
83
|
-
|
|
84
|
-
Lint/LiteralInInterpolation:
|
|
85
|
-
Enabled: true
|
|
86
|
-
|
|
87
|
-
Lint/RedundantStringCoercion:
|
|
88
|
-
Enabled: true
|
|
89
|
-
|
|
90
|
-
Lint/BooleanSymbol:
|
|
91
|
-
Enabled: true
|
|
92
|
-
AutoCorrect: false # it breaks the code
|
|
93
|
-
|
|
94
|
-
Lint/ShadowedArgument:
|
|
95
|
-
Enabled: true
|
|
96
|
-
|
|
97
|
-
Lint/RedundantCopDisableDirective:
|
|
98
|
-
Enabled: true
|
|
99
|
-
|
|
100
|
-
Lint/EmptyEnsure:
|
|
101
|
-
Enabled: true
|
|
102
|
-
|
|
103
|
-
Lint/RedundantWithObject:
|
|
104
|
-
Enabled: true
|
|
105
|
-
|
|
106
|
-
Lint/SelfAssignment:
|
|
107
|
-
Enabled: true
|
|
108
|
-
|
|
109
|
-
Lint/Void:
|
|
110
|
-
Enabled: true
|
|
111
|
-
|
|
112
|
-
Lint/UselessMethodDefinition:
|
|
113
|
-
Enabled: true
|
|
114
|
-
|
|
115
|
-
Lint/UnreachableCode:
|
|
116
|
-
Enabled: true
|
|
117
|
-
|
|
118
|
-
Lint/DeprecatedOpenSSLConstant:
|
|
119
|
-
Enabled: true
|
|
120
|
-
|
|
121
|
-
Lint/DisjunctiveAssignmentInConstructor:
|
|
122
|
-
Enabled: true
|
|
123
|
-
|
|
124
|
-
Lint/NonLocalExitFromIterator:
|
|
125
|
-
Enabled: true
|
|
126
|
-
|
|
127
|
-
Lint/DeprecatedClassMethods:
|
|
128
|
-
Enabled: true
|
|
129
|
-
|
|
130
|
-
Lint/SafeNavigationChain:
|
|
131
|
-
Enabled: true
|
|
132
|
-
|
|
133
|
-
Lint/RedundantSafeNavigation:
|
|
134
|
-
Enabled: true
|
|
135
|
-
|
|
136
|
-
Lint/EmptyConditionalBody:
|
|
137
|
-
Enabled: true
|
|
138
|
-
|
|
139
|
-
Lint/SafeNavigationConsistency:
|
|
140
|
-
Enabled: true
|
|
141
|
-
|
|
142
|
-
Lint/OrAssignmentToConstant:
|
|
143
|
-
Enabled: true
|
|
1
|
+
inherit_gem:
|
|
2
|
+
rubocop-discourse-base: rubocop-core.yml
|
data/rubocop-discourse.gemspec
CHANGED
|
@@ -12,12 +12,25 @@ Gem::Specification.new do |s|
|
|
|
12
12
|
s.license = "MIT"
|
|
13
13
|
s.homepage = "https://github.com/discourse/rubocop-discourse"
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
config_files = %w[
|
|
16
|
+
default.yml
|
|
17
|
+
rubocop-core.yml
|
|
18
|
+
rubocop-layout.yml
|
|
19
|
+
rubocop-capybara.yml
|
|
20
|
+
rubocop-factory_bot.yml
|
|
21
|
+
rubocop-rspec.yml
|
|
22
|
+
rubocop-rails.yml
|
|
23
|
+
stree-compat.yml
|
|
24
|
+
config/default.yml
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
s.files = %w[LICENSE README.md rubocop-discourse.gemspec] + config_files + Dir["lib/**/*.rb"]
|
|
16
28
|
s.require_paths = ["lib"]
|
|
17
29
|
s.metadata["default_lint_roller_plugin"] = "RuboCop::Discourse::Plugin"
|
|
18
30
|
|
|
31
|
+
s.required_ruby_version = ">= 3.0"
|
|
19
32
|
s.add_runtime_dependency "activesupport", ">= 6.1"
|
|
20
|
-
s.add_runtime_dependency "rubocop", ">= 1.
|
|
33
|
+
s.add_runtime_dependency "rubocop-discourse-base", ">= 1.0.0"
|
|
21
34
|
s.add_runtime_dependency "rubocop-rspec", ">= 3.0.1"
|
|
22
35
|
s.add_runtime_dependency "rubocop-factory_bot", ">= 2.27.0"
|
|
23
36
|
s.add_runtime_dependency "rubocop-capybara", ">= 2.22.0"
|
data/rubocop-layout.yml
CHANGED
|
@@ -1,80 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Enabled: true
|
|
4
|
-
|
|
5
|
-
# Align comments with method definitions.
|
|
6
|
-
Layout/CommentIndentation:
|
|
7
|
-
Enabled: true
|
|
8
|
-
|
|
9
|
-
# No extra empty lines.
|
|
10
|
-
Layout/EmptyLines:
|
|
11
|
-
Enabled: true
|
|
12
|
-
|
|
13
|
-
# Use empty lines between definitions.
|
|
14
|
-
Layout/EmptyLineBetweenDefs:
|
|
15
|
-
Enabled: true
|
|
16
|
-
|
|
17
|
-
# Two spaces, no tabs (for indentation).
|
|
18
|
-
Layout/IndentationWidth:
|
|
19
|
-
Enabled: true
|
|
20
|
-
|
|
21
|
-
Layout/SpaceAfterColon:
|
|
22
|
-
Enabled: true
|
|
23
|
-
|
|
24
|
-
Layout/SpaceAfterComma:
|
|
25
|
-
Enabled: true
|
|
26
|
-
|
|
27
|
-
Layout/SpaceAroundEqualsInParameterDefault:
|
|
28
|
-
Enabled: true
|
|
29
|
-
|
|
30
|
-
Layout/SpaceAroundKeyword:
|
|
31
|
-
Enabled: true
|
|
32
|
-
|
|
33
|
-
Layout/SpaceAroundOperators:
|
|
34
|
-
Enabled: true
|
|
35
|
-
|
|
36
|
-
Layout/SpaceBeforeFirstArg:
|
|
37
|
-
Enabled: true
|
|
38
|
-
|
|
39
|
-
# Use `foo {}` not `foo{}`.
|
|
40
|
-
Layout/SpaceBeforeBlockBraces:
|
|
41
|
-
Enabled: true
|
|
42
|
-
|
|
43
|
-
# Use `foo { bar }` not `foo {bar}`.
|
|
44
|
-
Layout/SpaceInsideBlockBraces:
|
|
45
|
-
Enabled: true
|
|
46
|
-
|
|
47
|
-
# Use `{ a: 1 }` not `{a:1}`.
|
|
48
|
-
Layout/SpaceInsideHashLiteralBraces:
|
|
49
|
-
Enabled: true
|
|
50
|
-
|
|
51
|
-
Layout/SpaceInsideParens:
|
|
52
|
-
Enabled: true
|
|
53
|
-
|
|
54
|
-
# Detect hard tabs, no hard tabs.
|
|
55
|
-
Layout/IndentationStyle:
|
|
56
|
-
Enabled: true
|
|
57
|
-
|
|
58
|
-
# Blank lines should not have any spaces.
|
|
59
|
-
Layout/TrailingEmptyLines:
|
|
60
|
-
Enabled: true
|
|
61
|
-
|
|
62
|
-
# No trailing whitespace.
|
|
63
|
-
Layout/TrailingWhitespace:
|
|
64
|
-
Enabled: true
|
|
65
|
-
|
|
66
|
-
Layout/BlockAlignment:
|
|
67
|
-
Enabled: true
|
|
68
|
-
|
|
69
|
-
# Align `end` with the matching keyword or starting expression except for
|
|
70
|
-
# assignments, where it should be aligned with the LHS.
|
|
71
|
-
Layout/EndAlignment:
|
|
72
|
-
Enabled: true
|
|
73
|
-
EnforcedStyleAlignWith: variable
|
|
74
|
-
|
|
75
|
-
Layout/MultilineMethodCallIndentation:
|
|
76
|
-
Enabled: true
|
|
77
|
-
EnforcedStyle: indented
|
|
78
|
-
|
|
79
|
-
Layout/HashAlignment:
|
|
80
|
-
Enabled: true
|
|
1
|
+
inherit_gem:
|
|
2
|
+
rubocop-discourse-base: rubocop-layout.yml
|
data/rubocop-rspec.yml
CHANGED
|
@@ -1,37 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
inherit_mode:
|
|
2
|
+
merge:
|
|
3
|
+
- plugins
|
|
4
|
+
- Exclude
|
|
5
|
+
- Include
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
RSpec/AroundBlock:
|
|
9
|
-
Enabled: true
|
|
7
|
+
inherit_gem:
|
|
8
|
+
rubocop-discourse-base: rubocop-rspec.yml
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
RSpec/ChangeByZero:
|
|
15
|
-
Enabled: true
|
|
16
|
-
|
|
17
|
-
RSpec/ContextMethod:
|
|
18
|
-
Enabled: true
|
|
19
|
-
|
|
20
|
-
RSpec/ContextWording:
|
|
21
|
-
Enabled: true
|
|
22
|
-
Prefixes:
|
|
23
|
-
- when
|
|
24
|
-
- with
|
|
25
|
-
- without
|
|
26
|
-
- for
|
|
27
|
-
- while
|
|
28
|
-
- if
|
|
29
|
-
- as
|
|
30
|
-
- after
|
|
31
|
-
- in
|
|
10
|
+
plugins:
|
|
11
|
+
- rubocop-rspec_rails
|
|
32
12
|
|
|
33
13
|
RSpec/DescribeClass:
|
|
34
|
-
Enabled: true
|
|
35
14
|
Exclude:
|
|
36
15
|
- "**/spec/features/**/*"
|
|
37
16
|
- "**/spec/requests/**/*"
|
|
@@ -45,194 +24,9 @@ RSpec/DescribeClass:
|
|
|
45
24
|
- "**/spec/lib/freedom_patches/**/*"
|
|
46
25
|
- "**/spec/multisite/**/*"
|
|
47
26
|
|
|
48
|
-
RSpec/DescribeMethod:
|
|
49
|
-
Enabled: true
|
|
50
|
-
|
|
51
|
-
RSpec/DescribeSymbol:
|
|
52
|
-
Enabled: false # To be decided
|
|
53
|
-
|
|
54
|
-
RSpec/DescribedClass:
|
|
55
|
-
Enabled: false # To be decided
|
|
56
|
-
|
|
57
|
-
RSpec/DescribedClassModuleWrapping:
|
|
58
|
-
Enabled: true
|
|
59
|
-
|
|
60
27
|
RSpec/EmptyExampleGroup:
|
|
61
|
-
Enabled: true
|
|
62
28
|
Exclude:
|
|
63
29
|
- "spec/requests/api/*"
|
|
64
30
|
|
|
65
|
-
RSpec/EmptyLineAfterExample:
|
|
66
|
-
Enabled: false # TODO
|
|
67
|
-
|
|
68
|
-
RSpec/EmptyLineAfterExampleGroup:
|
|
69
|
-
Enabled: false # TODO
|
|
70
|
-
|
|
71
|
-
RSpec/EmptyLineAfterFinalLet:
|
|
72
|
-
Enabled: false # TODO
|
|
73
|
-
|
|
74
|
-
RSpec/EmptyLineAfterHook:
|
|
75
|
-
Enabled: false # TODO
|
|
76
|
-
|
|
77
|
-
RSpec/EmptyLineAfterSubject:
|
|
78
|
-
Enabled: true
|
|
79
|
-
|
|
80
|
-
RSpec/ExampleLength:
|
|
81
|
-
Enabled: false # To be decided
|
|
82
|
-
|
|
83
|
-
RSpec/ExampleWithoutDescription:
|
|
84
|
-
Enabled: true
|
|
85
|
-
|
|
86
|
-
RSpec/ExampleWording:
|
|
87
|
-
Enabled: false # TODO
|
|
88
|
-
|
|
89
|
-
RSpec/ExpectActual:
|
|
90
|
-
Enabled: true
|
|
91
|
-
|
|
92
|
-
RSpec/ExpectChange:
|
|
93
|
-
Enabled: false # To be decided
|
|
94
|
-
|
|
95
|
-
RSpec/ExpectInHook:
|
|
96
|
-
Enabled: false
|
|
97
|
-
|
|
98
|
-
RSpec/ExpectOutput:
|
|
99
|
-
Enabled: true
|
|
100
|
-
|
|
101
|
-
RSpec/SpecFilePathFormat:
|
|
102
|
-
Enabled: false # To be decided
|
|
103
|
-
|
|
104
|
-
RSpec/SpecFilePathSuffix:
|
|
105
|
-
Enabled: true
|
|
106
|
-
|
|
107
|
-
RSpec/Focus:
|
|
108
|
-
Enabled: true
|
|
109
|
-
|
|
110
|
-
RSpec/HookArgument:
|
|
111
|
-
Enabled: false # TODO
|
|
112
|
-
|
|
113
|
-
RSpec/HooksBeforeExamples:
|
|
114
|
-
Enabled: false # TODO
|
|
115
|
-
|
|
116
|
-
RSpec/ImplicitBlockExpectation:
|
|
117
|
-
Enabled: true
|
|
118
|
-
|
|
119
|
-
RSpec/ImplicitExpect:
|
|
120
|
-
Enabled: false # To be decided
|
|
121
|
-
|
|
122
|
-
RSpec/ImplicitSubject:
|
|
123
|
-
Enabled: false # To be decided
|
|
124
|
-
|
|
125
|
-
RSpec/InstanceSpy:
|
|
126
|
-
Enabled: true
|
|
127
|
-
|
|
128
|
-
RSpec/InstanceVariable:
|
|
129
|
-
Enabled: false # TODO
|
|
130
|
-
|
|
131
|
-
RSpec/ItBehavesLike:
|
|
132
|
-
Enabled: true
|
|
133
|
-
|
|
134
|
-
RSpec/IteratedExpectation:
|
|
135
|
-
Enabled: false # To be decided
|
|
136
|
-
|
|
137
|
-
RSpec/LeadingSubject:
|
|
138
|
-
Enabled: true
|
|
139
|
-
|
|
140
|
-
RSpec/LeakyConstantDeclaration:
|
|
141
|
-
Enabled: false # To be decided
|
|
142
|
-
|
|
143
|
-
RSpec/LetBeforeExamples:
|
|
144
|
-
Enabled: false # TODO
|
|
145
|
-
|
|
146
|
-
RSpec/LetSetup:
|
|
147
|
-
Enabled: false # TODO
|
|
148
|
-
|
|
149
|
-
RSpec/MessageChain:
|
|
150
|
-
Enabled: true
|
|
151
|
-
|
|
152
|
-
RSpec/MessageSpies:
|
|
153
|
-
Enabled: true
|
|
154
|
-
|
|
155
|
-
RSpec/MissingExampleGroupArgument:
|
|
156
|
-
Enabled: true
|
|
157
|
-
|
|
158
|
-
RSpec/MultipleExpectations:
|
|
159
|
-
Enabled: false
|
|
160
|
-
|
|
161
|
-
RSpec/MultipleDescribes:
|
|
162
|
-
Enabled: false # TODO
|
|
163
|
-
|
|
164
|
-
RSpec/MultipleMemoizedHelpers:
|
|
165
|
-
Enabled: false
|
|
166
|
-
|
|
167
|
-
RSpec/MultipleSubjects:
|
|
168
|
-
Enabled: true
|
|
169
|
-
|
|
170
|
-
RSpec/NamedSubject:
|
|
171
|
-
Enabled: true
|
|
172
|
-
|
|
173
|
-
RSpec/NestedGroups:
|
|
174
|
-
Enabled: false # To be decided
|
|
175
|
-
|
|
176
|
-
RSpec/OverwritingSetup:
|
|
177
|
-
Enabled: true
|
|
178
|
-
|
|
179
|
-
RSpec/ReceiveCounts:
|
|
180
|
-
Enabled: true
|
|
181
|
-
|
|
182
|
-
RSpec/ReceiveNever:
|
|
183
|
-
Enabled: true
|
|
184
|
-
|
|
185
|
-
RSpec/RepeatedDescription:
|
|
186
|
-
Enabled: false
|
|
187
|
-
|
|
188
|
-
RSpec/RepeatedExample:
|
|
189
|
-
Enabled: false # TODO
|
|
190
|
-
|
|
191
|
-
RSpec/RepeatedExampleGroupBody:
|
|
192
|
-
Enabled: false # TODO
|
|
193
|
-
|
|
194
|
-
RSpec/RepeatedExampleGroupDescription:
|
|
195
|
-
Enabled: false
|
|
196
|
-
|
|
197
|
-
RSpec/ReturnFromStub:
|
|
198
|
-
Enabled: true
|
|
199
|
-
|
|
200
|
-
RSpec/ScatteredSetup:
|
|
201
|
-
Enabled: false # TODO
|
|
202
|
-
|
|
203
|
-
RSpec/SharedContext:
|
|
204
|
-
Enabled: true
|
|
205
|
-
|
|
206
|
-
RSpec/SharedExamples:
|
|
207
|
-
Enabled: true
|
|
208
|
-
|
|
209
|
-
RSpec/SingleArgumentMessageChain:
|
|
210
|
-
Enabled: true
|
|
211
|
-
|
|
212
|
-
RSpec/SubjectStub:
|
|
213
|
-
Enabled: true
|
|
214
|
-
|
|
215
|
-
RSpec/UnspecifiedException:
|
|
216
|
-
Enabled: true
|
|
217
|
-
|
|
218
|
-
RSpec/VerifiedDoubles:
|
|
219
|
-
Enabled: true
|
|
220
|
-
|
|
221
|
-
RSpec/VoidExpect:
|
|
222
|
-
Enabled: true
|
|
223
|
-
|
|
224
|
-
RSpec/Yield:
|
|
225
|
-
Enabled: true
|
|
226
|
-
|
|
227
|
-
RSpec/Dialect:
|
|
228
|
-
Enabled: true
|
|
229
|
-
PreferredMethods:
|
|
230
|
-
background: :before
|
|
231
|
-
scenario: :it
|
|
232
|
-
xscenario: :xit
|
|
233
|
-
given: :let
|
|
234
|
-
given!: :let!
|
|
235
|
-
feature: :describe
|
|
236
|
-
|
|
237
31
|
RSpecRails/HttpStatus:
|
|
238
32
|
Enabled: true
|