rubocop-slim 0.2.8 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cc13d20db409e4be47e6572f26316aa1f769a2075e3e467aea4da80264376c0
4
- data.tar.gz: e8c6412e4601f6959723ffb5aaecc00cb54a5ab57af01245a0b5009aec652e1c
3
+ metadata.gz: a6b17810c7076a0df19bfba739148ac83e8d3c4dd463794e17cf7bb24848d858
4
+ data.tar.gz: a98d8b2d0d0af271492dbdb025cb9561d85f74a18f43c941eea3a02fdadaf6c7
5
5
  SHA512:
6
- metadata.gz: 5ccaa0d63a42c0b5dc73ce7d91b43c56793300c913c1b45a9534a6caba6b08912abc6fb2e677ac9b5eb97c0231d737141970df7a5ab91b17164d1bec067318fa
7
- data.tar.gz: 894a0ddcda52e388bb88a5d7c29dfbf142fd94900e73ef3bd4ff79d72baae87c9689a6de41690482214ab4868f9d05429f966994541a882ed29b1bbca714892d
6
+ metadata.gz: 91a09bf8d5c45488cac1f56a03c00566d07dcfb57abb8cd8ba815942cd697a6f80bb44b592094af59ce31a181a83f69150c7795448da5ee854a28630acb5c0ab
7
+ data.tar.gz: a956d13dfe32745b8b0387fe056a16b661419ef456f83524d7d7f870a0fedc5e54c5ba4b7679016550efd0081c0d25159ea060326887f506461b2362602be2f7
data/.rubocop.yml CHANGED
@@ -1,4 +1,4 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-rake
3
3
  - rubocop-rspec
4
4
  - rubocop-slim
data/Gemfile.lock CHANGED
@@ -1,93 +1,106 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rubocop-slim (0.2.8)
5
- rubocop (~> 1.45)
4
+ rubocop-slim (0.3.1)
5
+ lint_roller (>= 1.1)
6
+ rubocop (>= 1.72.1)
6
7
  slimi (~> 0.7)
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
10
11
  specs:
11
- activesupport (7.1.3.4)
12
+ activesupport (7.1.5.1)
12
13
  base64
14
+ benchmark (>= 0.3)
13
15
  bigdecimal
14
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
15
17
  connection_pool (>= 2.2.5)
16
18
  drb
17
19
  i18n (>= 1.6, < 2)
20
+ logger (>= 1.4.2)
18
21
  minitest (>= 5.1)
19
22
  mutex_m
23
+ securerandom (>= 0.3)
20
24
  tzinfo (~> 2.0)
21
- ast (2.4.2)
25
+ ast (2.4.3)
22
26
  base64 (0.2.0)
23
- bigdecimal (3.1.8)
24
- concurrent-ruby (1.3.3)
25
- connection_pool (2.4.1)
26
- diff-lcs (1.5.1)
27
+ benchmark (0.4.0)
28
+ bigdecimal (3.1.9)
29
+ concurrent-ruby (1.3.5)
30
+ connection_pool (2.5.0)
31
+ diff-lcs (1.6.1)
27
32
  drb (2.2.1)
28
- i18n (1.14.5)
33
+ i18n (1.14.7)
29
34
  concurrent-ruby (~> 1.0)
30
- json (2.7.2)
31
- language_server-protocol (3.17.0.3)
32
- minitest (5.24.1)
33
- mutex_m (0.2.0)
34
- parallel (1.25.1)
35
- parser (3.3.4.0)
35
+ json (2.10.2)
36
+ language_server-protocol (3.17.0.4)
37
+ lint_roller (1.1.0)
38
+ logger (1.7.0)
39
+ minitest (5.25.5)
40
+ mutex_m (0.3.0)
41
+ parallel (1.26.3)
42
+ parser (3.3.7.4)
36
43
  ast (~> 2.4.1)
37
44
  racc
38
- racc (1.8.0)
45
+ prism (1.4.0)
46
+ racc (1.8.1)
39
47
  rainbow (3.1.1)
40
48
  rake (13.2.1)
41
- regexp_parser (2.9.2)
42
- rexml (3.3.2)
43
- strscan
49
+ regexp_parser (2.10.0)
44
50
  rspec (3.13.0)
45
51
  rspec-core (~> 3.13.0)
46
52
  rspec-expectations (~> 3.13.0)
47
53
  rspec-mocks (~> 3.13.0)
48
- rspec-core (3.13.0)
54
+ rspec-core (3.13.3)
49
55
  rspec-support (~> 3.13.0)
50
- rspec-expectations (3.13.1)
56
+ rspec-expectations (3.13.3)
51
57
  diff-lcs (>= 1.2.0, < 2.0)
52
58
  rspec-support (~> 3.13.0)
53
- rspec-mocks (3.13.1)
59
+ rspec-mocks (3.13.2)
54
60
  diff-lcs (>= 1.2.0, < 2.0)
55
61
  rspec-support (~> 3.13.0)
56
- rspec-support (3.13.1)
57
- rubocop (1.65.0)
62
+ rspec-support (3.13.2)
63
+ rubocop (1.75.2)
58
64
  json (~> 2.3)
59
- language_server-protocol (>= 3.17.0)
65
+ language_server-protocol (~> 3.17.0.2)
66
+ lint_roller (~> 1.1.0)
60
67
  parallel (~> 1.10)
61
68
  parser (>= 3.3.0.2)
62
69
  rainbow (>= 2.2.2, < 4.0)
63
- regexp_parser (>= 2.4, < 3.0)
64
- rexml (>= 3.2.5, < 4.0)
65
- rubocop-ast (>= 1.31.1, < 2.0)
70
+ regexp_parser (>= 2.9.3, < 3.0)
71
+ rubocop-ast (>= 1.44.0, < 2.0)
66
72
  ruby-progressbar (~> 1.7)
67
- unicode-display_width (>= 2.4.0, < 3.0)
68
- rubocop-ast (1.31.3)
69
- parser (>= 3.3.1.0)
70
- rubocop-rake (0.6.0)
71
- rubocop (~> 1.0)
72
- rubocop-rspec (3.0.3)
73
- rubocop (~> 1.61)
73
+ unicode-display_width (>= 2.4.0, < 4.0)
74
+ rubocop-ast (1.44.0)
75
+ parser (>= 3.3.7.2)
76
+ prism (~> 1.4)
77
+ rubocop-rake (0.7.1)
78
+ lint_roller (~> 1.1)
79
+ rubocop (>= 1.72.1)
80
+ rubocop-rspec (3.5.0)
81
+ lint_roller (~> 1.1)
82
+ rubocop (~> 1.72, >= 1.72.1)
74
83
  ruby-progressbar (1.13.0)
75
- sevencop (0.43.1)
84
+ securerandom (0.3.2)
85
+ sevencop (0.48.0)
76
86
  activesupport
77
- rubocop
78
- slimi (0.7.5)
87
+ lint_roller (>= 1.1)
88
+ rubocop (>= 1.72.1)
89
+ slimi (0.7.6)
79
90
  temple
80
91
  thor
81
92
  tilt
82
- strscan (3.1.0)
83
- temple (0.10.3)
84
- thor (1.3.2)
85
- tilt (2.4.0)
93
+ temple (0.10.4)
94
+ thor (1.4.0)
95
+ tilt (2.6.1)
86
96
  tzinfo (2.0.6)
87
97
  concurrent-ruby (~> 1.0)
88
- unicode-display_width (2.5.0)
98
+ unicode-display_width (3.1.4)
99
+ unicode-emoji (~> 4.0, >= 4.0.4)
100
+ unicode-emoji (4.0.4)
89
101
 
90
102
  PLATFORMS
103
+ ruby
91
104
  x86_64-linux
92
105
 
93
106
  DEPENDENCIES
data/README.md CHANGED
@@ -20,11 +20,11 @@ gem install rubocop-slim
20
20
 
21
21
  ## Usage
22
22
 
23
- Require `rubocop-slim` in your RuboCop config.
23
+ Add `rubocop-slim` to plugins.
24
24
 
25
25
  ```yaml
26
26
  # .rubocop.yml
27
- require:
27
+ plugins:
28
28
  - rubocop-slim
29
29
  ```
30
30
 
data/config/default.yml CHANGED
@@ -175,6 +175,10 @@ Style/ParallelAssignment:
175
175
  Exclude:
176
176
  - '**/*.slim'
177
177
 
178
+ Style/RedundantParentheses:
179
+ Exclude:
180
+ - '**/*.slim'
181
+
178
182
  Style/RescueModifier:
179
183
  Exclude:
180
184
  - '**/*.slim'
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lint_roller'
4
+
5
+ module RuboCop
6
+ module Slim
7
+ class Plugin < ::LintRoller::Plugin
8
+ def about
9
+ ::LintRoller::About.new(
10
+ description: 'RuboCop plugin for Slim template.',
11
+ homepage: 'https://github.com/r7kamura/rubocop-slim',
12
+ name: 'rubocop-slim',
13
+ version: VERSION
14
+ )
15
+ end
16
+
17
+ def rules(_context)
18
+ ::RuboCop::Runner.ruby_extractors.unshift(::RuboCop::Slim::RubyExtractor)
19
+
20
+ ::LintRoller::Rules.new(
21
+ config_format: :rubocop,
22
+ type: :path,
23
+ value: "#{__dir__}/../../../config/default.yml"
24
+ )
25
+ end
26
+
27
+ def supported?(context)
28
+ context.engine == :rubocop
29
+ end
30
+ end
31
+ end
32
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Slim
5
- VERSION = '0.2.8'
5
+ VERSION = '0.3.1'
6
6
  end
7
7
  end
data/lib/rubocop/slim.rb CHANGED
@@ -11,5 +11,5 @@ module RuboCop
11
11
  end
12
12
  end
13
13
 
14
- require_relative 'slim/rubocop_extension'
14
+ require_relative 'slim/plugin'
15
15
  require_relative 'slim/version'
data/rubocop-slim.gemspec CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.metadata['homepage_uri'] = spec.homepage
17
17
  spec.metadata['source_code_uri'] = spec.homepage
18
18
  spec.metadata['changelog_uri'] = "#{spec.homepage}/releases"
19
+ spec.metadata['default_lint_roller_plugin'] = 'RuboCop::Slim::Plugin'
19
20
 
20
21
  # Specify which files should be added to the gem when it is released.
21
22
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -28,6 +29,7 @@ Gem::Specification.new do |spec|
28
29
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
30
  spec.require_paths = ['lib']
30
31
 
31
- spec.add_dependency 'rubocop', '~> 1.45'
32
+ spec.add_dependency 'lint_roller', '>= 1.1'
33
+ spec.add_dependency 'rubocop', '>= 1.72.1'
32
34
  spec.add_dependency 'slimi', '~> 0.7'
33
35
  end
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-slim
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-01 00:00:00.000000000 Z
11
+ date: 2025-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: lint_roller
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '1.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '1.1'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rubocop
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
- - - "~>"
31
+ - - ">="
18
32
  - !ruby/object:Gem::Version
19
- version: '1.45'
33
+ version: 1.72.1
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
- - - "~>"
38
+ - - ">="
25
39
  - !ruby/object:Gem::Version
26
- version: '1.45'
40
+ version: 1.72.1
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: slimi
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -38,7 +52,7 @@ dependencies:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0.7'
41
- description:
55
+ description:
42
56
  email:
43
57
  - r7kamura@gmail.com
44
58
  executables: []
@@ -58,8 +72,8 @@ files:
58
72
  - lib/rubocop/slim.rb
59
73
  - lib/rubocop/slim/config_loader.rb
60
74
  - lib/rubocop/slim/keyword_remover.rb
75
+ - lib/rubocop/slim/plugin.rb
61
76
  - lib/rubocop/slim/processed_source_builder.rb
62
- - lib/rubocop/slim/rubocop_extension.rb
63
77
  - lib/rubocop/slim/ruby_clip.rb
64
78
  - lib/rubocop/slim/ruby_extractor.rb
65
79
  - lib/rubocop/slim/version.rb
@@ -72,7 +86,8 @@ metadata:
72
86
  homepage_uri: https://github.com/r7kamura/rubocop-slim
73
87
  source_code_uri: https://github.com/r7kamura/rubocop-slim
74
88
  changelog_uri: https://github.com/r7kamura/rubocop-slim/releases
75
- post_install_message:
89
+ default_lint_roller_plugin: RuboCop::Slim::Plugin
90
+ post_install_message:
76
91
  rdoc_options: []
77
92
  require_paths:
78
93
  - lib
@@ -88,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
103
  version: '0'
89
104
  requirements: []
90
105
  rubygems_version: 3.3.27
91
- signing_key:
106
+ signing_key:
92
107
  specification_version: 4
93
108
  summary: RuboCop plugin for Slim template.
94
109
  test_files: []
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rubocop'
4
-
5
- RuboCop::Runner.ruby_extractors.unshift(RuboCop::Slim::RubyExtractor)
6
-
7
- RuboCop::ConfigLoader.instance_variable_set(
8
- :@default_configuration,
9
- RuboCop::Slim::ConfigLoader.call
10
- )