rubocop-scc 0.2.1 → 0.2.2
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/config/default.yml +71 -68
- data/config/rails.yml +1 -1
- data/lib/rubocop/cop/sequioacap/class_name.rb +6 -6
- data/lib/rubocop/cop/sequioacap/default_scope.rb +1 -1
- data/lib/rubocop/cop/sequioacap/factory_class_use_string.rb +3 -3
- data/lib/rubocop/cop/sequioacap/no_timeout.rb +2 -2
- data/lib/rubocop/cop/sequioacap/simple_modifier_conditional.rb +1 -1
- metadata +25 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78494b0a918b525ad912cda5e333c3cda12f328b9a318a6c97929e563311db61
|
4
|
+
data.tar.gz: b369263e3fe3c0a7a03e59f62ff712726bca05cc9f3aa52c4c66810e50bba08a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b27de17b481f3d9a512919cfad59059b06ffde9ec0982e80c246b15816866f05196da4cb8d158d6ce87579b3cca94aa041d02d5be9a37927acb59b348ff774b6
|
7
|
+
data.tar.gz: 91d161c566f0a557b8d26aa13525b69f0cfe0faf0363b1c75f74c790e3b2a8676d361def26ae099112b76df07e85f3b741178aeba340be20382cd718b3f39816
|
data/config/default.yml
CHANGED
@@ -7,10 +7,10 @@ Bundler/DuplicatedGem:
|
|
7
7
|
Enabled: true
|
8
8
|
|
9
9
|
Bundler/InsecureProtocolSource:
|
10
|
-
Enabled:
|
10
|
+
Enabled: false
|
11
11
|
|
12
12
|
Bundler/OrderedGems:
|
13
|
-
Enabled:
|
13
|
+
Enabled: false
|
14
14
|
|
15
15
|
Layout/AccessModifierIndentation:
|
16
16
|
Enabled: true
|
@@ -444,73 +444,73 @@ Style/BlockDelimiters:
|
|
444
444
|
Enabled: true
|
445
445
|
EnforcedStyle: line_count_based
|
446
446
|
SupportedStyles:
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
447
|
+
# The `line_count_based` style enforces braces around single line blocks and
|
448
|
+
# do..end around multi-line blocks.
|
449
|
+
- line_count_based
|
450
|
+
# The `semantic` style enforces braces around functional blocks, where the
|
451
|
+
# primary purpose of the block is to return a value and do..end for
|
452
|
+
# procedural blocks, where the primary purpose of the block is its
|
453
|
+
# side-effects.
|
454
|
+
#
|
455
|
+
# This looks at the usage of a block's method to determine its type (e.g. is
|
456
|
+
# the result of a `map` assigned to a variable or passed to another
|
457
|
+
# method) but exceptions are permitted in the `ProceduralMethods`,
|
458
|
+
# `FunctionalMethods` and `IgnoredMethods` sections below.
|
459
|
+
- semantic
|
460
|
+
# The `braces_for_chaining` style enforces braces around single line blocks
|
461
|
+
# and do..end around multi-line blocks, except for multi-line blocks whose
|
462
|
+
# return value is being chained with another method (in which case braces
|
463
|
+
# are enforced).
|
464
|
+
- braces_for_chaining
|
465
465
|
ProceduralMethods:
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
466
|
+
# Methods that are known to be procedural in nature but look functional from
|
467
|
+
# their usage, e.g.
|
468
|
+
#
|
469
|
+
# time = Benchmark.realtime do
|
470
|
+
# foo.bar
|
471
|
+
# end
|
472
|
+
#
|
473
|
+
# Here, the return value of the block is discarded but the return value of
|
474
|
+
# `Benchmark.realtime` is used.
|
475
|
+
- benchmark
|
476
|
+
- bm
|
477
|
+
- bmbm
|
478
|
+
- create
|
479
|
+
- each_with_object
|
480
|
+
- measure
|
481
|
+
- new
|
482
|
+
- realtime
|
483
|
+
- tap
|
484
|
+
- with_object
|
485
485
|
FunctionalMethods:
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
486
|
+
# Methods that are known to be functional in nature but look procedural from
|
487
|
+
# their usage, e.g.
|
488
|
+
#
|
489
|
+
# let(:foo) { Foo.new }
|
490
|
+
#
|
491
|
+
# Here, the return value of `Foo.new` is used to define a `foo` helper but
|
492
|
+
# doesn't appear to be used from the return value of `let`.
|
493
|
+
- let
|
494
|
+
- let!
|
495
|
+
- subject
|
496
|
+
- watch
|
497
497
|
IgnoredMethods:
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
498
|
+
# Methods that can be either procedural or functional and cannot be
|
499
|
+
# categorised from their usage alone, e.g.
|
500
|
+
#
|
501
|
+
# foo = lambda do |x|
|
502
|
+
# puts "Hello, #{x}"
|
503
|
+
# end
|
504
|
+
#
|
505
|
+
# foo = lambda do |x|
|
506
|
+
# x * 100
|
507
|
+
# end
|
508
|
+
#
|
509
|
+
# Here, it is impossible to tell from the return value of `lambda` whether
|
510
|
+
# the inner block's return value is significant.
|
511
|
+
- lambda
|
512
|
+
- proc
|
513
|
+
- it
|
514
514
|
|
515
515
|
Style/BracesAroundHashParameters:
|
516
516
|
Enabled: true
|
@@ -587,7 +587,10 @@ Style/InfiniteLoop:
|
|
587
587
|
Style/InlineComment:
|
588
588
|
Enabled: true
|
589
589
|
|
590
|
-
Style/
|
590
|
+
Style/MethodMissingSuper:
|
591
|
+
Enabled: true
|
592
|
+
|
593
|
+
Style/MissingRespondToMissing:
|
591
594
|
Enabled: true
|
592
595
|
|
593
596
|
Style/MinMax:
|
@@ -677,4 +680,4 @@ Gemspec/DuplicatedAssignment:
|
|
677
680
|
Enabled: true
|
678
681
|
|
679
682
|
Gemspec/OrderedDependencies:
|
680
|
-
Enabled:
|
683
|
+
Enabled: false
|
data/config/rails.yml
CHANGED
@@ -16,9 +16,9 @@ module RuboCop
|
|
16
16
|
# class name is a hardcoded string. If not, add an offense and return true.
|
17
17
|
def on_send(node)
|
18
18
|
association_statement =
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
node.command?(:has_many) ||
|
20
|
+
node.command?(:has_one) ||
|
21
|
+
node.command?(:belongs_to)
|
22
22
|
|
23
23
|
return unless association_statement
|
24
24
|
|
@@ -36,8 +36,8 @@ module RuboCop
|
|
36
36
|
def class_name_node(node)
|
37
37
|
node.descendants.detect do |e|
|
38
38
|
e.is_a?(Parser::AST::Node) &&
|
39
|
-
|
40
|
-
|
39
|
+
e.pair_type? &&
|
40
|
+
e.children[0].children[0] == :class_name
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
@@ -48,4 +48,4 @@ module RuboCop
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
51
|
-
|
51
|
+
end
|
@@ -28,8 +28,8 @@ module RuboCop
|
|
28
28
|
def class_node(node)
|
29
29
|
node.descendants.detect do |e|
|
30
30
|
e.is_a?(Parser::AST::Node) &&
|
31
|
-
|
32
|
-
|
31
|
+
e.pair_type? &&
|
32
|
+
e.children[0].children[0] == :class
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -40,4 +40,4 @@ module RuboCop
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
43
|
-
|
43
|
+
end
|
@@ -7,7 +7,7 @@ module RuboCop
|
|
7
7
|
module Sequioacap
|
8
8
|
class NoTimeout < Cop
|
9
9
|
MSG =
|
10
|
-
|
10
|
+
'Do not use Timeout.timeout. In combination with Rails autoloading, ' \
|
11
11
|
'timeout can cause Segmentation Faults in version of Ruby we use. ' \
|
12
12
|
'It can also cause logic errors since it can raise in ' \
|
13
13
|
'any callee scope. Use client library timeouts and monitoring to ' \
|
@@ -20,4 +20,4 @@ module RuboCop
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
23
|
-
|
23
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-scc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- borisding
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -16,28 +16,34 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.61.1
|
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:
|
26
|
+
version: 0.61.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: actionview
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '5.
|
33
|
+
version: '5.2'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 5.2.2
|
34
37
|
type: :development
|
35
38
|
prerelease: false
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
37
40
|
requirements:
|
38
41
|
- - "~>"
|
39
42
|
- !ruby/object:Gem::Version
|
40
|
-
version: '5.
|
43
|
+
version: '5.2'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 5.2.2
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: erubis
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,6 +65,9 @@ dependencies:
|
|
59
65
|
- - "~>"
|
60
66
|
- !ruby/object:Gem::Version
|
61
67
|
version: '5.11'
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 5.11.3
|
62
71
|
type: :development
|
63
72
|
prerelease: false
|
64
73
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -66,6 +75,9 @@ dependencies:
|
|
66
75
|
- - "~>"
|
67
76
|
- !ruby/object:Gem::Version
|
68
77
|
version: '5.11'
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 5.11.3
|
69
81
|
- !ruby/object:Gem::Dependency
|
70
82
|
name: rake
|
71
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,6 +85,9 @@ dependencies:
|
|
73
85
|
- - "~>"
|
74
86
|
- !ruby/object:Gem::Version
|
75
87
|
version: '12.3'
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 12.3.2
|
76
91
|
type: :development
|
77
92
|
prerelease: false
|
78
93
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -80,6 +95,9 @@ dependencies:
|
|
80
95
|
- - "~>"
|
81
96
|
- !ruby/object:Gem::Version
|
82
97
|
version: '12.3'
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: 12.3.2
|
83
101
|
description: Code style checking for Sequoia Capital China Ruby projects
|
84
102
|
email: lding@sequoiacap.com
|
85
103
|
executables: []
|
@@ -124,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
142
|
version: '0'
|
125
143
|
requirements: []
|
126
144
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.7.
|
145
|
+
rubygems_version: 2.7.8
|
128
146
|
signing_key:
|
129
147
|
specification_version: 4
|
130
148
|
summary: RuboCop SCC
|