rubocop-haml 0.2.3 → 0.3.0
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/.rubocop.yml +2 -2
- data/Gemfile.lock +31 -28
- data/README.md +4 -1
- data/config/default.yml +1 -1
- data/lib/rubocop/haml/plugin.rb +33 -0
- data/lib/rubocop/haml/version.rb +1 -1
- data/lib/rubocop/haml.rb +1 -2
- data/rubocop-haml.gemspec +4 -2
- metadata +21 -7
- data/lib/rubocop/haml/config_loader.rb +0 -50
- data/lib/rubocop/haml/rubocop_extension.rb +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47ddfb2e1827922ddaf74a81fa1b0edd11e6e1be4665a94cde2edb2d1a49728c
|
4
|
+
data.tar.gz: 94f6fabb4eb318a33615078c73d84500cb8c27cba0224e7a1c91e7750d7610e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c3c15f33e7d36c870944e18df5ab6740b3dc60bf3825441dce7c18ffc78e84578364ad6e7fa325fdd5d2d620a2765ebbefd7222041a4b8be1084cb4bcf1234e
|
7
|
+
data.tar.gz: e3315dd99e041a559b5a5e4a3e2cf764535a8a2151cb4443f3553b218e2e2de4f80252a9a6d6a72d7740069825b273e387d6e493a275148d53c3c30da2e96da1
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,63 +1,66 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rubocop-haml (0.
|
4
|
+
rubocop-haml (0.3.0)
|
5
5
|
hamli (~> 0.5)
|
6
|
-
|
6
|
+
lint_roller (~> 1.1)
|
7
|
+
rubocop (~> 1.72.1)
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
10
11
|
specs:
|
11
12
|
ast (2.4.2)
|
12
|
-
diff-lcs (1.
|
13
|
+
diff-lcs (1.6.0)
|
13
14
|
hamli (0.5.1)
|
14
15
|
temple
|
15
|
-
json (2.
|
16
|
-
language_server-protocol (3.17.0.
|
17
|
-
|
18
|
-
|
16
|
+
json (2.10.1)
|
17
|
+
language_server-protocol (3.17.0.4)
|
18
|
+
lint_roller (1.1.0)
|
19
|
+
parallel (1.26.3)
|
20
|
+
parser (3.3.7.1)
|
19
21
|
ast (~> 2.4.1)
|
20
22
|
racc
|
21
|
-
racc (1.8.
|
23
|
+
racc (1.8.1)
|
22
24
|
rainbow (3.1.1)
|
23
25
|
rake (13.2.1)
|
24
|
-
regexp_parser (2.
|
25
|
-
rexml (3.3.2)
|
26
|
-
strscan
|
26
|
+
regexp_parser (2.10.0)
|
27
27
|
rspec (3.13.0)
|
28
28
|
rspec-core (~> 3.13.0)
|
29
29
|
rspec-expectations (~> 3.13.0)
|
30
30
|
rspec-mocks (~> 3.13.0)
|
31
|
-
rspec-core (3.13.
|
31
|
+
rspec-core (3.13.3)
|
32
32
|
rspec-support (~> 3.13.0)
|
33
|
-
rspec-expectations (3.13.
|
33
|
+
rspec-expectations (3.13.3)
|
34
34
|
diff-lcs (>= 1.2.0, < 2.0)
|
35
35
|
rspec-support (~> 3.13.0)
|
36
|
-
rspec-mocks (3.13.
|
36
|
+
rspec-mocks (3.13.2)
|
37
37
|
diff-lcs (>= 1.2.0, < 2.0)
|
38
38
|
rspec-support (~> 3.13.0)
|
39
|
-
rspec-support (3.13.
|
40
|
-
rubocop (1.
|
39
|
+
rspec-support (3.13.2)
|
40
|
+
rubocop (1.72.2)
|
41
41
|
json (~> 2.3)
|
42
|
-
language_server-protocol (
|
42
|
+
language_server-protocol (~> 3.17.0.2)
|
43
|
+
lint_roller (~> 1.1.0)
|
43
44
|
parallel (~> 1.10)
|
44
45
|
parser (>= 3.3.0.2)
|
45
46
|
rainbow (>= 2.2.2, < 4.0)
|
46
|
-
regexp_parser (>= 2.
|
47
|
-
|
48
|
-
rubocop-ast (>= 1.31.1, < 2.0)
|
47
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
48
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
49
49
|
ruby-progressbar (~> 1.7)
|
50
|
-
unicode-display_width (>= 2.4.0, <
|
51
|
-
rubocop-ast (1.
|
50
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
51
|
+
rubocop-ast (1.38.0)
|
52
52
|
parser (>= 3.3.1.0)
|
53
|
-
rubocop-rake (0.
|
54
|
-
|
55
|
-
|
56
|
-
|
53
|
+
rubocop-rake (0.7.0)
|
54
|
+
lint_roller (~> 1.1)
|
55
|
+
rubocop (>= 1.72.1)
|
56
|
+
rubocop-rspec (3.5.0)
|
57
|
+
lint_roller (~> 1.1)
|
58
|
+
rubocop (~> 1.72, >= 1.72.1)
|
57
59
|
ruby-progressbar (1.13.0)
|
58
|
-
strscan (3.1.0)
|
59
60
|
temple (0.10.3)
|
60
|
-
unicode-display_width (
|
61
|
+
unicode-display_width (3.1.4)
|
62
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
63
|
+
unicode-emoji (4.0.4)
|
61
64
|
|
62
65
|
PLATFORMS
|
63
66
|
x86_64-linux
|
data/README.md
CHANGED
@@ -22,10 +22,13 @@ Require `rubocop-haml` in your RuboCop config.
|
|
22
22
|
|
23
23
|
```yaml
|
24
24
|
# .rubocop.yml
|
25
|
-
|
25
|
+
plugins:
|
26
26
|
- rubocop-haml
|
27
27
|
```
|
28
28
|
|
29
|
+
> [!NOTE]
|
30
|
+
> The plugin system is supported in RuboCop 1.72+. In earlier versions, use `require` instead of `plugins`.
|
31
|
+
|
29
32
|
Now you can use RuboCop also for Haml templates.
|
30
33
|
|
31
34
|
```
|
data/config/default.yml
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'lint_roller'
|
4
|
+
|
5
|
+
module RuboCop
|
6
|
+
module Haml
|
7
|
+
# A plugin that integrates rubocop-haml with RuboCop's plugin system.
|
8
|
+
class Plugin < LintRoller::Plugin
|
9
|
+
def about
|
10
|
+
LintRoller::About.new(
|
11
|
+
name: 'rubocop-haml',
|
12
|
+
version: VERSION,
|
13
|
+
homepage: 'https://github.com/r7kamura/rubocop-haml',
|
14
|
+
description: 'RuboCop plugin for Haml template.'
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
def supported?(context)
|
19
|
+
context.engine == :rubocop
|
20
|
+
end
|
21
|
+
|
22
|
+
def rules(_context)
|
23
|
+
RuboCop::Runner.ruby_extractors.unshift(RuboCop::Haml::RubyExtractor)
|
24
|
+
|
25
|
+
LintRoller::Rules.new(
|
26
|
+
type: :path,
|
27
|
+
config_format: :rubocop,
|
28
|
+
value: Pathname.new(__dir__).join('../../../config/default.yml')
|
29
|
+
)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/rubocop/haml/version.rb
CHANGED
data/lib/rubocop/haml.rb
CHANGED
@@ -2,12 +2,11 @@
|
|
2
2
|
|
3
3
|
module RuboCop
|
4
4
|
module Haml
|
5
|
-
autoload :ConfigLoader, 'rubocop/haml/config_loader'
|
6
5
|
autoload :RubyClip, 'rubocop/haml/ruby_clip'
|
7
6
|
autoload :RubyClipper, 'rubocop/haml/ruby_clipper'
|
8
7
|
autoload :RubyExtractor, 'rubocop/haml/ruby_extractor'
|
9
8
|
end
|
10
9
|
end
|
11
10
|
|
12
|
-
require_relative 'haml/
|
11
|
+
require_relative 'haml/plugin'
|
13
12
|
require_relative 'haml/version'
|
data/rubocop-haml.gemspec
CHANGED
@@ -11,11 +11,12 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = 'RuboCop plugin for Haml template.'
|
12
12
|
spec.homepage = 'https://github.com/r7kamura/rubocop-haml'
|
13
13
|
spec.license = 'MIT'
|
14
|
-
spec.required_ruby_version = '>= 2.
|
14
|
+
spec.required_ruby_version = '>= 2.7.0'
|
15
15
|
|
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::Haml::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.
|
@@ -29,5 +30,6 @@ Gem::Specification.new do |spec|
|
|
29
30
|
spec.require_paths = ['lib']
|
30
31
|
|
31
32
|
spec.add_dependency 'hamli', '~> 0.5'
|
32
|
-
spec.add_dependency '
|
33
|
+
spec.add_dependency 'lint_roller', '~> 1.1'
|
34
|
+
spec.add_dependency 'rubocop', '~> 1.72.1'
|
33
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-haml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hamli
|
@@ -24,20 +24,34 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.5'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: lint_roller
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.1'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rubocop
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
47
|
+
version: 1.72.1
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
54
|
+
version: 1.72.1
|
41
55
|
description:
|
42
56
|
email:
|
43
57
|
- r7kamura@gmail.com
|
@@ -56,8 +70,7 @@ files:
|
|
56
70
|
- config/default.yml
|
57
71
|
- lib/rubocop-haml.rb
|
58
72
|
- lib/rubocop/haml.rb
|
59
|
-
- lib/rubocop/haml/
|
60
|
-
- lib/rubocop/haml/rubocop_extension.rb
|
73
|
+
- lib/rubocop/haml/plugin.rb
|
61
74
|
- lib/rubocop/haml/ruby_clip.rb
|
62
75
|
- lib/rubocop/haml/ruby_clipper.rb
|
63
76
|
- lib/rubocop/haml/ruby_extractor.rb
|
@@ -70,6 +83,7 @@ metadata:
|
|
70
83
|
homepage_uri: https://github.com/r7kamura/rubocop-haml
|
71
84
|
source_code_uri: https://github.com/r7kamura/rubocop-haml
|
72
85
|
changelog_uri: https://github.com/r7kamura/rubocop-haml/releases
|
86
|
+
default_lint_roller_plugin: RuboCop::Haml::Plugin
|
73
87
|
post_install_message:
|
74
88
|
rdoc_options: []
|
75
89
|
require_paths:
|
@@ -78,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
92
|
requirements:
|
79
93
|
- - ">="
|
80
94
|
- !ruby/object:Gem::Version
|
81
|
-
version: 2.
|
95
|
+
version: 2.7.0
|
82
96
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
97
|
requirements:
|
84
98
|
- - ">="
|
@@ -1,50 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'rubocop'
|
4
|
-
|
5
|
-
module RuboCop
|
6
|
-
module Haml
|
7
|
-
# Merge default RuboCop config with plugin config.
|
8
|
-
class ConfigLoader
|
9
|
-
PLUGIN_CONFIG_PATH = ::File.expand_path(
|
10
|
-
'../../../config/default.yml',
|
11
|
-
__dir__
|
12
|
-
)
|
13
|
-
|
14
|
-
class << self
|
15
|
-
# @return [RuboCop::Config]
|
16
|
-
def call
|
17
|
-
new.call
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
# @return [RuboCop::Config]
|
22
|
-
def call
|
23
|
-
RuboCop::ConfigLoader.merge_with_default(
|
24
|
-
plugin_config,
|
25
|
-
PLUGIN_CONFIG_PATH
|
26
|
-
)
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
# @return [RuboCop::Config]
|
32
|
-
def plugin_config
|
33
|
-
config = ::RuboCop::Config.new(
|
34
|
-
plugin_config_hash,
|
35
|
-
PLUGIN_CONFIG_PATH
|
36
|
-
)
|
37
|
-
config.make_excludes_absolute
|
38
|
-
config
|
39
|
-
end
|
40
|
-
|
41
|
-
# @return [Hash]
|
42
|
-
def plugin_config_hash
|
43
|
-
::RuboCop::ConfigLoader.send(
|
44
|
-
:load_yaml_configuration,
|
45
|
-
PLUGIN_CONFIG_PATH
|
46
|
-
)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|