rubocop-erb 0.3.1 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Gemfile.lock +36 -36
- data/config/default.yml +8 -0
- data/gemfiles/ruby_2.7.gemfile.lock +4 -4
- data/lib/rubocop/erb/ruby_extractor.rb +23 -8
- data/lib/rubocop/erb/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c57699be856b07c099f05fb62bdb69d656e008af86319f739c5e35a902628f84
|
4
|
+
data.tar.gz: 5094efa6732c052e82eb56a44c3547dc52af06594b5a7cc648f63d4bcd39ac8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf57a7afa7c9990b85dc9028d0bf0353c076cd8cf37702e329d6d1bbe911d34f557d48d5ce324c8400f3679e6bdcd85c27977a01d7a61567d4b0bdfcd753c26e
|
7
|
+
data.tar.gz: a9307f9f21a006152684219c01a4d683df8259eb155872c2dbf96be15d995a60924238b71648d0bda6987f01450ff5189177b5f4d5bbfaa2b8617b4a5959f92e
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rubocop-erb (0.
|
4
|
+
rubocop-erb (0.4.1)
|
5
5
|
better_html
|
6
6
|
rubocop (~> 1.45)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actionview (7.1.2)
|
12
|
-
activesupport (= 7.1.2)
|
11
|
+
actionview (7.1.3.2)
|
12
|
+
activesupport (= 7.1.3.2)
|
13
13
|
builder (~> 3.1)
|
14
14
|
erubi (~> 1.11)
|
15
15
|
rails-dom-testing (~> 2.2)
|
16
16
|
rails-html-sanitizer (~> 1.6)
|
17
|
-
activesupport (7.1.2)
|
17
|
+
activesupport (7.1.3.2)
|
18
18
|
base64
|
19
19
|
bigdecimal
|
20
20
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
@@ -26,37 +26,37 @@ GEM
|
|
26
26
|
tzinfo (~> 2.0)
|
27
27
|
ast (2.4.2)
|
28
28
|
base64 (0.2.0)
|
29
|
-
better_html (2.
|
29
|
+
better_html (2.1.1)
|
30
30
|
actionview (>= 6.0)
|
31
31
|
activesupport (>= 6.0)
|
32
32
|
ast (~> 2.0)
|
33
33
|
erubi (~> 1.4)
|
34
34
|
parser (>= 2.4)
|
35
35
|
smart_properties
|
36
|
-
bigdecimal (3.1.
|
37
|
-
builder (3.
|
38
|
-
concurrent-ruby (1.2.
|
36
|
+
bigdecimal (3.1.6)
|
37
|
+
builder (3.3.0)
|
38
|
+
concurrent-ruby (1.2.3)
|
39
39
|
connection_pool (2.4.1)
|
40
40
|
crass (1.0.6)
|
41
|
-
diff-lcs (1.5.
|
42
|
-
drb (2.2.
|
43
|
-
|
44
|
-
|
45
|
-
i18n (1.14.1)
|
41
|
+
diff-lcs (1.5.1)
|
42
|
+
drb (2.2.1)
|
43
|
+
erubi (1.13.0)
|
44
|
+
i18n (1.14.4)
|
46
45
|
concurrent-ruby (~> 1.0)
|
47
46
|
json (2.7.1)
|
48
47
|
language_server-protocol (3.17.0.3)
|
49
48
|
loofah (2.22.0)
|
50
49
|
crass (~> 1.0.2)
|
51
50
|
nokogiri (>= 1.12.0)
|
52
|
-
minitest (5.
|
51
|
+
minitest (5.22.2)
|
53
52
|
mutex_m (0.2.0)
|
54
|
-
nokogiri (1.16.
|
53
|
+
nokogiri (1.16.6-x86_64-linux)
|
55
54
|
racc (~> 1.4)
|
56
55
|
parallel (1.24.0)
|
57
|
-
parser (3.3.0.
|
56
|
+
parser (3.3.0.5)
|
58
57
|
ast (~> 2.4.1)
|
59
58
|
racc
|
59
|
+
prism (0.24.0)
|
60
60
|
racc (1.7.3)
|
61
61
|
rails-dom-testing (2.2.0)
|
62
62
|
activesupport (>= 5.0.0)
|
@@ -67,47 +67,46 @@ GEM
|
|
67
67
|
nokogiri (~> 1.14)
|
68
68
|
rainbow (3.1.1)
|
69
69
|
rake (13.1.0)
|
70
|
-
regexp_parser (2.
|
70
|
+
regexp_parser (2.9.0)
|
71
71
|
rexml (3.2.6)
|
72
|
-
rspec (3.
|
73
|
-
rspec-core (~> 3.
|
74
|
-
rspec-expectations (~> 3.
|
75
|
-
rspec-mocks (~> 3.
|
76
|
-
rspec-core (3.
|
77
|
-
rspec-support (~> 3.
|
78
|
-
rspec-expectations (3.
|
72
|
+
rspec (3.13.0)
|
73
|
+
rspec-core (~> 3.13.0)
|
74
|
+
rspec-expectations (~> 3.13.0)
|
75
|
+
rspec-mocks (~> 3.13.0)
|
76
|
+
rspec-core (3.13.0)
|
77
|
+
rspec-support (~> 3.13.0)
|
78
|
+
rspec-expectations (3.13.0)
|
79
79
|
diff-lcs (>= 1.2.0, < 2.0)
|
80
|
-
rspec-support (~> 3.
|
81
|
-
rspec-mocks (3.
|
80
|
+
rspec-support (~> 3.13.0)
|
81
|
+
rspec-mocks (3.13.0)
|
82
82
|
diff-lcs (>= 1.2.0, < 2.0)
|
83
|
-
rspec-support (~> 3.
|
84
|
-
rspec-support (3.
|
85
|
-
rubocop (1.
|
83
|
+
rspec-support (~> 3.13.0)
|
84
|
+
rspec-support (3.13.1)
|
85
|
+
rubocop (1.62.0)
|
86
86
|
json (~> 2.3)
|
87
87
|
language_server-protocol (>= 3.17.0)
|
88
88
|
parallel (~> 1.10)
|
89
|
-
parser (>= 3.
|
89
|
+
parser (>= 3.3.0.2)
|
90
90
|
rainbow (>= 2.2.2, < 4.0)
|
91
91
|
regexp_parser (>= 1.8, < 3.0)
|
92
92
|
rexml (>= 3.2.5, < 4.0)
|
93
|
-
rubocop-ast (>= 1.
|
93
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
94
94
|
ruby-progressbar (~> 1.7)
|
95
95
|
unicode-display_width (>= 2.4.0, < 3.0)
|
96
|
-
rubocop-ast (1.
|
97
|
-
parser (>= 3.
|
96
|
+
rubocop-ast (1.31.1)
|
97
|
+
parser (>= 3.3.0.4)
|
98
98
|
rubocop-capybara (2.20.0)
|
99
99
|
rubocop (~> 1.41)
|
100
100
|
rubocop-factory_bot (2.25.1)
|
101
101
|
rubocop (~> 1.41)
|
102
102
|
rubocop-rake (0.6.0)
|
103
103
|
rubocop (~> 1.0)
|
104
|
-
rubocop-rspec (2.
|
104
|
+
rubocop-rspec (2.27.1)
|
105
105
|
rubocop (~> 1.40)
|
106
106
|
rubocop-capybara (~> 2.17)
|
107
107
|
rubocop-factory_bot (~> 2.22)
|
108
108
|
ruby-progressbar (1.13.0)
|
109
|
-
|
110
|
-
sevencop (0.35.1)
|
109
|
+
sevencop (0.38.0)
|
111
110
|
activesupport
|
112
111
|
rubocop
|
113
112
|
smart_properties (1.17.0)
|
@@ -119,6 +118,7 @@ PLATFORMS
|
|
119
118
|
x86_64-linux
|
120
119
|
|
121
120
|
DEPENDENCIES
|
121
|
+
prism
|
122
122
|
rake
|
123
123
|
rspec
|
124
124
|
rubocop-erb!
|
data/config/default.yml
CHANGED
@@ -79,6 +79,10 @@ Layout/LeadingEmptyLine:
|
|
79
79
|
Exclude:
|
80
80
|
- '**/*.erb'
|
81
81
|
|
82
|
+
Layout/LeadingEmptyLines:
|
83
|
+
Exclude:
|
84
|
+
- '**/*.erb'
|
85
|
+
|
82
86
|
Layout/LineEndStringConcatenationIndentation:
|
83
87
|
Exclude:
|
84
88
|
- '**/*.erb'
|
@@ -131,6 +135,10 @@ Lint/EmptyFile:
|
|
131
135
|
Exclude:
|
132
136
|
- '**/*.erb'
|
133
137
|
|
138
|
+
Lint/OutOfRangeRegexpRef:
|
139
|
+
Exclude:
|
140
|
+
- '**/*.erb'
|
141
|
+
|
134
142
|
Lint/SyntaxError:
|
135
143
|
Exclude:
|
136
144
|
- '**/*.erb'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
rubocop-erb (0.
|
4
|
+
rubocop-erb (0.4.1)
|
5
5
|
better_html
|
6
6
|
rubocop (~> 1.45)
|
7
7
|
|
@@ -26,7 +26,7 @@ GEM
|
|
26
26
|
tzinfo (~> 2.0)
|
27
27
|
ast (2.4.2)
|
28
28
|
base64 (0.2.0)
|
29
|
-
better_html (2.
|
29
|
+
better_html (2.1.1)
|
30
30
|
actionview (>= 6.0)
|
31
31
|
activesupport (>= 6.0)
|
32
32
|
ast (~> 2.0)
|
@@ -34,14 +34,14 @@ GEM
|
|
34
34
|
parser (>= 2.4)
|
35
35
|
smart_properties
|
36
36
|
bigdecimal (3.1.5)
|
37
|
-
builder (3.
|
37
|
+
builder (3.3.0)
|
38
38
|
concurrent-ruby (1.2.2)
|
39
39
|
connection_pool (2.4.1)
|
40
40
|
crass (1.0.6)
|
41
41
|
diff-lcs (1.5.0)
|
42
42
|
drb (2.2.0)
|
43
43
|
ruby2_keywords
|
44
|
-
erubi (1.
|
44
|
+
erubi (1.13.0)
|
45
45
|
i18n (1.14.1)
|
46
46
|
concurrent-ruby (~> 1.0)
|
47
47
|
json (2.7.1)
|
@@ -26,16 +26,9 @@ module RuboCop
|
|
26
26
|
return unless supported_file_path_pattern?
|
27
27
|
|
28
28
|
ruby_clips.map do |ruby_clip|
|
29
|
-
processed_source = ::RuboCop::ProcessedSource.new(
|
30
|
-
ruby_clip.code,
|
31
|
-
@processed_source.ruby_version,
|
32
|
-
file_path
|
33
|
-
)
|
34
|
-
processed_source.config = @processed_source.config
|
35
|
-
processed_source.registry = @processed_source.registry
|
36
29
|
{
|
37
30
|
offset: ruby_clip.offset,
|
38
|
-
processed_source:
|
31
|
+
processed_source: ruby_clip_to_processed_source(ruby_clip)
|
39
32
|
}
|
40
33
|
end
|
41
34
|
end
|
@@ -73,6 +66,28 @@ module RuboCop
|
|
73
66
|
).ast
|
74
67
|
end
|
75
68
|
|
69
|
+
# @return [RuboCop::ProcessedSource]
|
70
|
+
def ruby_clip_to_processed_source(ruby_clip)
|
71
|
+
supports_prism = @processed_source.respond_to?(:parser_engine)
|
72
|
+
processed_source = if supports_prism
|
73
|
+
::RuboCop::ProcessedSource.new(
|
74
|
+
ruby_clip.code,
|
75
|
+
@processed_source.ruby_version,
|
76
|
+
file_path,
|
77
|
+
parser_engine: @processed_source.parser_engine
|
78
|
+
)
|
79
|
+
else
|
80
|
+
::RuboCop::ProcessedSource.new(
|
81
|
+
ruby_clip.code,
|
82
|
+
@processed_source.ruby_version,
|
83
|
+
file_path
|
84
|
+
)
|
85
|
+
end
|
86
|
+
processed_source.config = @processed_source.config
|
87
|
+
processed_source.registry = @processed_source.registry
|
88
|
+
processed_source
|
89
|
+
end
|
90
|
+
|
76
91
|
# @return [Array<RuboCop::Erb::RubyClip>]
|
77
92
|
def ruby_clips
|
78
93
|
nodes.map do |node|
|
data/lib/rubocop/erb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-erb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: better_html
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
|
-
rubygems_version: 3.3.
|
90
|
+
rubygems_version: 3.3.27
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
93
|
summary: RuboCop plugin for ERB template.
|