rubocop-github 0.12.0 → 0.13.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
- SHA1:
3
- metadata.gz: 01a43ac030793e95e3a335bc67ba74c70b16458c
4
- data.tar.gz: a2a30083e9282c76625c20cf0409acefa21f3f58
2
+ SHA256:
3
+ metadata.gz: 58ddfb6fbfe780a05b368dea76dc36274bc05065088e606592ba87dd82372e65
4
+ data.tar.gz: 209ce2b5181fa610a44a704df33b2571ad8034c1eb0e0be7620530f31ba707bb
5
5
  SHA512:
6
- metadata.gz: b3ff7a090f8e44d261b65437e8e5eda5b9698fc01fc1b257aeb26f19971414b8e583e66a8791ec6d4ace5fcee0ce2235801578549b3706796d39d76b0b4d2272
7
- data.tar.gz: 4d0dcb8096da4fd18437da5ef483452df9924b170bd4507b194baf2faadeb4549bdb7fd310561e0369fd849f357098fb39063e1a0f51c4d41e38284eaa94e3a3
6
+ metadata.gz: 36d6bfbc4936221bd01eeffa1667a5f421aca8039b134d3918e9587be3b8778819062d42e4f464b93c62ff3caecb297d4ace38c3d214b94289a1a02c69b9d81a
7
+ data.tar.gz: dadce863318b8ca16f6f3f5a0fd8e9827cc992df3f1e925d57f5711e12d79bff79996a451f0fa81ae795d46971ea8a17fb727d4db6756a8194449228b8310f90
data/README.md CHANGED
@@ -19,6 +19,11 @@ inherit_gem:
19
19
  - config/rails.yml
20
20
  ```
21
21
 
22
+ ## Testing
23
+
24
+ `bundle install`
25
+ `bundle exec rake test`
26
+
22
27
  ## The Cops
23
28
 
24
29
  All cops are located under [`lib/rubocop/cop/github`](lib/rubocop/cop/github), and contain examples/documentation.
@@ -1,4 +1,6 @@
1
- require: rubocop/cop/github
1
+ require:
2
+ - rubocop/cop/github
3
+ - rubocop-performance
2
4
 
3
5
  AllCops:
4
6
  DisabledByDefault: true
@@ -115,6 +117,9 @@ Lint/EndInMethod:
115
117
  Lint/EnsureReturn:
116
118
  Enabled: true
117
119
 
120
+ Lint/FlipFlop:
121
+ Enabled: true
122
+
118
123
  Lint/FloatOutOfRange:
119
124
  Enabled: true
120
125
 
@@ -226,9 +231,6 @@ Performance/EndWith:
226
231
  Performance/FlatMap:
227
232
  Enabled: true
228
233
 
229
- Performance/LstripRstrip:
230
- Enabled: true
231
-
232
234
  Performance/RangeInclude:
233
235
  Enabled: false
234
236
 
@@ -239,15 +241,9 @@ Performance/RedundantMerge:
239
241
  Enabled: true
240
242
  MaxKeyValuePairs: 1
241
243
 
242
- Performance/RedundantSortBy:
243
- Enabled: true
244
-
245
244
  Performance/ReverseEach:
246
245
  Enabled: true
247
246
 
248
- Performance/Sample:
249
- Enabled: true
250
-
251
247
  Performance/Size:
252
248
  Enabled: true
253
249
 
@@ -284,9 +280,6 @@ Style/DefWithParentheses:
284
280
  Style/EndBlock:
285
281
  Enabled: true
286
282
 
287
- Style/FlipFlop:
288
- Enabled: true
289
-
290
283
  Style/For:
291
284
  Enabled: true
292
285
 
@@ -318,9 +311,18 @@ Style/Not:
318
311
  Style/OneLineConditional:
319
312
  Enabled: true
320
313
 
314
+ Style/RedundantSortBy:
315
+ Enabled: true
316
+
317
+ Style/Sample:
318
+ Enabled: true
319
+
321
320
  Style/StabbyLambdaParentheses:
322
321
  Enabled: true
323
322
 
324
323
  Style/StringLiterals:
325
324
  Enabled: true
326
325
  EnforcedStyle: double_quotes
326
+
327
+ Style/Strip:
328
+ Enabled: true
@@ -116,3 +116,7 @@ Layout/TrailingBlankLines:
116
116
  Layout/TrailingWhitespace:
117
117
  Exclude:
118
118
  - 'app/views/**/*.erb'
119
+
120
+ Layout/InitialIndentation:
121
+ Exclude:
122
+ - 'app/views/**/*.erb'
@@ -20,6 +20,10 @@ module RuboCop
20
20
  (send nil? :render ({str sym} $_) $...)
21
21
  PATTERN
22
22
 
23
+ def_node_matcher :render_const?, <<-PATTERN
24
+ (send nil? :render (const _ _) ...)
25
+ PATTERN
26
+
23
27
  def_node_matcher :render_with_options?, <<-PATTERN
24
28
  (send nil? :render (hash $...))
25
29
  PATTERN
@@ -63,7 +67,7 @@ module RuboCop
63
67
  def on_send(node)
64
68
  return unless render?(node)
65
69
 
66
- if render_literal?(node)
70
+ if render_literal?(node) || render_const?(node)
67
71
  elsif option_pairs = render_with_options?(node)
68
72
  option_pairs = option_pairs.reject { |pair| options_key?(pair) }
69
73
 
@@ -20,6 +20,10 @@ module RuboCop
20
20
  (send nil? :render ({str sym} $_) $...)
21
21
  PATTERN
22
22
 
23
+ def_node_matcher :render_const?, <<-PATTERN
24
+ (send nil? :render (const _ _) ...)
25
+ PATTERN
26
+
23
27
  def_node_matcher :render_with_options?, <<-PATTERN
24
28
  (send nil? :render (hash $...) ...)
25
29
  PATTERN
@@ -33,6 +37,7 @@ module RuboCop
33
37
  def_node_matcher :partial_key?, <<-PATTERN
34
38
  (pair (sym {
35
39
  :file
40
+ :template
36
41
  :layout
37
42
  :partial
38
43
  }) $_)
@@ -41,7 +46,7 @@ module RuboCop
41
46
  def on_send(node)
42
47
  return unless render?(node)
43
48
 
44
- if render_literal?(node)
49
+ if render_literal?(node) || render_const?(node)
45
50
  elsif option_pairs = render_with_options?(node)
46
51
  if option_pairs.any? { |pair| ignore_key?(pair) }
47
52
  return
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitHub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-18 00:00:00.000000000 Z
11
+ date: 2019-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,14 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.59'
19
+ version: '0.70'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.59'
26
+ version: '0.70'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rubocop-performance
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.3.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.3.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: actionview
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -103,7 +117,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
103
117
  requirements:
104
118
  - - ">="
105
119
  - !ruby/object:Gem::Version
106
- version: 2.1.0
120
+ version: 2.3.6
107
121
  required_rubygems_version: !ruby/object:Gem::Requirement
108
122
  requirements:
109
123
  - - ">="
@@ -111,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
125
  version: '0'
112
126
  requirements: []
113
127
  rubyforge_project:
114
- rubygems_version: 2.6.12
128
+ rubygems_version: 2.7.6
115
129
  signing_key:
116
130
  specification_version: 4
117
131
  summary: RuboCop GitHub