rubocop-discourse 2.0.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e9b0623d47b96bbaa5a7e78f2da4e889d03bbce2f16e2ab90e9ce61530a69f9
4
- data.tar.gz: c3385aefb750fa0a379599f2ddce69a66d03186b1e0c21e1552f0c94e9347a96
3
+ metadata.gz: 6655fa53ae9c2bd93548aae8db88b78294303626031e03896131ca120c083021
4
+ data.tar.gz: f21f3ab9e4b3b184f7e26ab16e917ad77598c076fa3a4e0bc9a4280517b9bbcf
5
5
  SHA512:
6
- metadata.gz: 495b86ba2534d8d9b725628337eb70d0c96a2927aa6867f99ef59cd5b8c668530baf54637fe49f0fb08ba0b5c6b648cd2ce74a1b962af811f50d92cdb4bc6c31
7
- data.tar.gz: b37411ba21ac5c4fcf1e5586f8a5c2419c251e74937499fafe68b8ecb06b75bc881582f813ac8af8f0b8c77675c0e750b001fc75e004607f460f646399b924be
6
+ metadata.gz: df675e48cb73e337f4256161d8e16da66ca0c2b00c7402b983f221cc979b1594d0b8636d71672b8d16b7ea74b8be0d4d2ca94accb4dd49c2a3f7810ea13bde11
7
+ data.tar.gz: a2a12b9f318aa4fcb2f18adac55efc2bc8c05ffbb151085d9d1f607b0abaf623c13960fcbd18074efc92540b7feff7f1285efc3215dc8cf50615a437192b5a03
@@ -1,4 +1,20 @@
1
- inherit_from: https://raw.githubusercontent.com/discourse/discourse/master/.rubocop.yml
1
+ require:
2
+ - rubocop-discourse
3
+
4
+ inherit_from:
5
+ - ./rubocop-core.yml
6
+ - ./rubocop-rspec.yml
7
+
8
+ AllCops:
9
+ TargetRubyVersion: 2.6
10
+ DisabledByDefault: true
11
+ Exclude:
12
+ - "db/schema.rb"
13
+ - "bundle/**/*"
14
+ - "vendor/**/*"
15
+ - "node_modules/**/*"
16
+ - "public/**/*"
17
+ - "plugins/**/gems/**/*"
2
18
 
3
19
  Discourse:
4
20
  Enabled: true
@@ -0,0 +1,11 @@
1
+ # rubocop-discourse
2
+
3
+ ## Usage
4
+
5
+ Add `gem "rubocop-discourse"` to your Gemfile.
6
+ Then add the following to `.rubocop.yml`:
7
+
8
+ ```yml
9
+ inherit_gem:
10
+ rubocop-discourse: .rubocop.yml
11
+ ```
@@ -1,5 +1,8 @@
1
1
  Discourse/NoChdir:
2
2
  Enabled: true
3
+ Exclude:
4
+ - 'spec/**/*' # Specs are run sequentially, so chdir can be used
5
+ - 'plugins/*/spec/**/*'
3
6
 
4
7
  Discourse/NoDirectMultisiteManipulation:
5
8
  Enabled: true
@@ -0,0 +1,123 @@
1
+ # Prefer &&/|| over and/or.
2
+ Style/AndOr:
3
+ Enabled: true
4
+
5
+ Style/FrozenStringLiteralComment:
6
+ Enabled: true
7
+
8
+ # Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
9
+ Style/HashSyntax:
10
+ Enabled: true
11
+
12
+ # Defining a method with parameters needs parentheses.
13
+ Style/MethodDefParentheses:
14
+ Enabled: true
15
+
16
+ Style/SingleLineMethods:
17
+ Enabled: true
18
+
19
+ Style/Semicolon:
20
+ Enabled: true
21
+ AllowAsExpressionSeparator: true
22
+
23
+ Style/RedundantReturn:
24
+ Enabled: true
25
+
26
+ Style/GlobalVars:
27
+ Enabled: true
28
+ Severity: warning
29
+ Exclude:
30
+ - 'lib/tasks/**/*'
31
+ - 'script/**/*'
32
+ - 'spec/**/*.rb'
33
+ - 'plugins/*/spec/**/*'
34
+
35
+ # Align `when` with `case`.
36
+ Layout/CaseIndentation:
37
+ Enabled: true
38
+
39
+ # Align comments with method definitions.
40
+ Layout/CommentIndentation:
41
+ Enabled: true
42
+
43
+ # No extra empty lines.
44
+ Layout/EmptyLines:
45
+ Enabled: true
46
+
47
+ # Two spaces, no tabs (for indentation).
48
+ Layout/IndentationWidth:
49
+ Enabled: true
50
+
51
+ Layout/SpaceAfterColon:
52
+ Enabled: true
53
+
54
+ Layout/SpaceAfterComma:
55
+ Enabled: true
56
+
57
+ Layout/SpaceAroundEqualsInParameterDefault:
58
+ Enabled: true
59
+
60
+ Layout/SpaceAroundKeyword:
61
+ Enabled: true
62
+
63
+ Layout/SpaceAroundOperators:
64
+ Enabled: true
65
+
66
+ Layout/SpaceBeforeFirstArg:
67
+ Enabled: true
68
+
69
+ # Use `foo {}` not `foo{}`.
70
+ Layout/SpaceBeforeBlockBraces:
71
+ Enabled: true
72
+
73
+ # Use `foo { bar }` not `foo {bar}`.
74
+ Layout/SpaceInsideBlockBraces:
75
+ Enabled: true
76
+
77
+ # Use `{ a: 1 }` not `{a:1}`.
78
+ Layout/SpaceInsideHashLiteralBraces:
79
+ Enabled: true
80
+
81
+ Layout/SpaceInsideParens:
82
+ Enabled: true
83
+
84
+ # Detect hard tabs, no hard tabs.
85
+ Layout/IndentationStyle:
86
+ Enabled: true
87
+
88
+ # Blank lines should not have any spaces.
89
+ Layout/TrailingEmptyLines:
90
+ Enabled: true
91
+
92
+ # No trailing whitespace.
93
+ Layout/TrailingWhitespace:
94
+ Enabled: true
95
+
96
+ Layout/BlockAlignment:
97
+ Enabled: true
98
+
99
+ # Align `end` with the matching keyword or starting expression except for
100
+ # assignments, where it should be aligned with the LHS.
101
+ Layout/EndAlignment:
102
+ Enabled: true
103
+ EnforcedStyleAlignWith: variable
104
+
105
+ Layout/MultilineMethodCallIndentation:
106
+ Enabled: true
107
+ EnforcedStyle: indented
108
+
109
+ Layout/HashAlignment:
110
+ Enabled: true
111
+
112
+ Lint/Debugger:
113
+ Enabled: true
114
+
115
+ # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
116
+ Lint/RequireParentheses:
117
+ Enabled: true
118
+
119
+ Lint/ShadowingOuterLocalVariable:
120
+ Enabled: true
121
+
122
+ Bundler/OrderedGems:
123
+ Enabled: false
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "rubocop-discourse"
5
- s.version = "2.0.1"
5
+ s.version = "2.1.0"
6
6
  s.summary = "Custom rubocop cops used by Discourse"
7
7
  s.authors = ["David Taylor"]
8
8
  s.files = `git ls-files`.split($/)
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.require_paths = ["lib"]
11
11
 
12
12
  s.add_runtime_dependency "rubocop", ">= 0.69.0"
13
+ s.add_runtime_dependency "rubocop-rspec", ">= 1.39.0"
13
14
 
14
15
  s.add_development_dependency "rake", "~> 13.0"
15
16
  end
@@ -0,0 +1,211 @@
1
+ require:
2
+ - rubocop-rspec
3
+
4
+ RSpec/AnyInstance:
5
+ Enabled: false # To be decided
6
+
7
+ RSpec/AroundBlock:
8
+ Enabled: true
9
+
10
+ RSpec/BeforeAfterAll:
11
+ Enabled: false # To be decided
12
+
13
+ RSpec/ContextMethod:
14
+ Enabled: false # TODO
15
+
16
+ RSpec/ContextWording:
17
+ Enabled: false # To be decided
18
+
19
+ RSpec/DescribeClass:
20
+ Enabled: false # To be decided
21
+
22
+ RSpec/DescribeMethod:
23
+ Enabled: true
24
+
25
+ RSpec/DescribeSymbol:
26
+ Enabled: false # To be decided
27
+
28
+ RSpec/DescribedClass:
29
+ Enabled: false # To be decided
30
+
31
+ RSpec/DescribedClassModuleWrapping:
32
+ Enabled: false # To be decided
33
+
34
+ RSpec/EmptyExampleGroup:
35
+ Enabled: true
36
+ Exclude:
37
+ - 'spec/requests/api/*'
38
+
39
+ RSpec/EmptyLineAfterExample:
40
+ Enabled: false # TODO
41
+
42
+ RSpec/EmptyLineAfterExampleGroup:
43
+ Enabled: false # TODO
44
+
45
+ RSpec/EmptyLineAfterFinalLet:
46
+ Enabled: false # TODO
47
+
48
+ RSpec/EmptyLineAfterHook:
49
+ Enabled: false # TODO
50
+
51
+ RSpec/EmptyLineAfterSubject:
52
+ Enabled: false # TODO
53
+
54
+ RSpec/ExampleLength:
55
+ Enabled: false # To be decided
56
+
57
+ RSpec/ExampleWithoutDescription:
58
+ Enabled: true
59
+
60
+ RSpec/ExampleWording:
61
+ Enabled: false # TODO
62
+
63
+ RSpec/ExpectActual:
64
+ Enabled: true
65
+
66
+ RSpec/ExpectChange:
67
+ Enabled: false # To be decided
68
+
69
+ RSpec/ExpectInHook:
70
+ Enabled: false # To be decided
71
+
72
+ RSpec/ExpectOutput:
73
+ Enabled: true
74
+
75
+ RSpec/FilePath:
76
+ Enabled: false # To be decided
77
+
78
+ RSpec/Focus:
79
+ Enabled: true
80
+
81
+ RSpec/HookArgument:
82
+ Enabled: false # TODO
83
+
84
+ RSpec/HooksBeforeExamples:
85
+ Enabled: false # TODO
86
+
87
+ RSpec/ImplicitBlockExpectation:
88
+ Enabled: true
89
+
90
+ RSpec/ImplicitExpect:
91
+ Enabled: false # To be decided
92
+
93
+ RSpec/ImplicitSubject:
94
+ Enabled: false # To be decided
95
+
96
+ RSpec/InstanceSpy:
97
+ Enabled: true
98
+
99
+ RSpec/InstanceVariable:
100
+ Enabled: false # TODO
101
+
102
+ RSpec/InvalidPredicateMatcher:
103
+ Enabled: true
104
+
105
+ RSpec/ItBehavesLike:
106
+ Enabled: true
107
+
108
+ RSpec/IteratedExpectation:
109
+ Enabled: false # To be decided
110
+
111
+ RSpec/LeadingSubject:
112
+ Enabled: false # TODO
113
+
114
+ RSpec/LeakyConstantDeclaration:
115
+ Enabled: false # To be decided
116
+
117
+ RSpec/LetBeforeExamples:
118
+ Enabled: false # TODO
119
+
120
+ RSpec/LetSetup:
121
+ Enabled: false # TODO
122
+
123
+ RSpec/MessageChain:
124
+ Enabled: true
125
+
126
+ RSpec/MessageSpies:
127
+ Enabled: true
128
+
129
+ RSpec/MissingExampleGroupArgument:
130
+ Enabled: true
131
+
132
+ RSpec/MultipleDescribes:
133
+ Enabled: false # TODO
134
+
135
+ RSpec/MultipleSubjects:
136
+ Enabled: true
137
+
138
+ RSpec/NamedSubject:
139
+ Enabled: false # To be decided
140
+
141
+ RSpec/NestedGroups:
142
+ Enabled: false # To be decided
143
+
144
+ RSpec/OverwritingSetup:
145
+ Enabled: true
146
+
147
+ RSpec/ReceiveCounts:
148
+ Enabled: true
149
+
150
+ RSpec/ReceiveNever:
151
+ Enabled: true
152
+
153
+ RSpec/RepeatedDescription:
154
+ Enabled: false # TODO
155
+
156
+ RSpec/RepeatedExample:
157
+ Enabled: false # TODO
158
+
159
+ RSpec/RepeatedExampleGroupBody:
160
+ Enabled: false # TODO
161
+
162
+ RSpec/RepeatedExampleGroupDescription:
163
+ Enabled: false # TODO
164
+
165
+ RSpec/ReturnFromStub:
166
+ Enabled: true
167
+
168
+ RSpec/ScatteredSetup:
169
+ Enabled: false # TODO
170
+
171
+ RSpec/SharedContext:
172
+ Enabled: true
173
+
174
+ RSpec/SharedExamples:
175
+ Enabled: true
176
+
177
+ RSpec/SingleArgumentMessageChain:
178
+ Enabled: true
179
+
180
+ RSpec/SubjectStub:
181
+ Enabled: true
182
+
183
+ RSpec/UnspecifiedException:
184
+ Enabled: true
185
+
186
+ RSpec/VerifiedDoubles:
187
+ Enabled: true
188
+
189
+ RSpec/VoidExpect:
190
+ Enabled: true
191
+
192
+ RSpec/Yield:
193
+ Enabled: true
194
+
195
+ Capybara/CurrentPathExpectation:
196
+ Enabled: true
197
+
198
+ Capybara/FeatureMethods:
199
+ Enabled: true
200
+
201
+ FactoryBot/AttributeDefinedStatically:
202
+ Enabled: true
203
+
204
+ FactoryBot/CreateList:
205
+ Enabled: true
206
+
207
+ FactoryBot/FactoryClassName:
208
+ Enabled: true
209
+
210
+ Rails/HttpStatus:
211
+ Enabled: true
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-discourse
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Taylor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-24 00:00:00.000000000 Z
11
+ date: 2020-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.69.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop-rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.39.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 1.39.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rake
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -49,6 +63,7 @@ files:
49
63
  - ".rubocop.yml"
50
64
  - Gemfile
51
65
  - LICENSE
66
+ - README.md
52
67
  - Rakefile
53
68
  - config/default.yml
54
69
  - lib/rubocop-discourse.rb
@@ -60,7 +75,9 @@ files:
60
75
  - lib/rubocop/cop/discourse_cops.rb
61
76
  - lib/rubocop/discourse.rb
62
77
  - lib/rubocop/discourse/inject.rb
78
+ - rubocop-core.yml
63
79
  - rubocop-discourse.gemspec
80
+ - rubocop-rspec.yml
64
81
  homepage:
65
82
  licenses:
66
83
  - MIT