hamlcop 0.1.0 → 0.1.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +3 -3
- data/README.md +22 -0
- data/lib/hamlcop/ruby_extractor.rb +4 -6
- data/lib/hamlcop/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7eb701026d10635ab662d88acc0e9acc9dd3cd1e8dcaa9a693b8ec8c5acf40a8
|
4
|
+
data.tar.gz: 8f91cb613fbe423f6c4cc472dbeb9dcf7c619dd5f268710b029ef2aac3338093
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 956292487536587c65c7185932e56915867794f6242dca07688425cdcba2974f0c26a2036592c59169c81ef11f41e23e6342e800a4496e48c4ab5b22a6eec843
|
7
|
+
data.tar.gz: 270cee5eca23b804bdc2129feb2f10a7a70ca3948c1b615e922d8e94b715d157843fede6e975f193b7f4dc4ddf62cd19fea03e24bf40c468ad6b554e44d5c05f
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hamlcop (0.1.
|
4
|
+
hamlcop (0.1.1)
|
5
5
|
hamli (>= 0.2)
|
6
6
|
templatecop
|
7
7
|
|
@@ -10,7 +10,7 @@ GEM
|
|
10
10
|
specs:
|
11
11
|
ast (2.4.2)
|
12
12
|
diff-lcs (1.5.0)
|
13
|
-
hamli (0.
|
13
|
+
hamli (0.5.1)
|
14
14
|
temple
|
15
15
|
parallel (1.21.0)
|
16
16
|
parser (3.1.0.0)
|
@@ -46,7 +46,7 @@ GEM
|
|
46
46
|
rubocop-rspec (2.8.0)
|
47
47
|
rubocop (~> 1.19)
|
48
48
|
ruby-progressbar (1.11.0)
|
49
|
-
templatecop (0.
|
49
|
+
templatecop (0.3.0)
|
50
50
|
parallel
|
51
51
|
parser
|
52
52
|
rubocop (>= 0.87)
|
data/README.md
CHANGED
@@ -36,3 +36,25 @@ Usage: hamlcop [options] [file1, file2, ...]
|
|
36
36
|
-c, --config= Specify configuration file.
|
37
37
|
--[no-]color Force color output on or off.
|
38
38
|
```
|
39
|
+
|
40
|
+
### Example
|
41
|
+
|
42
|
+
```console
|
43
|
+
$ hamlcop "spec/fixtures/**/*.haml"
|
44
|
+
Inspecting 1 file
|
45
|
+
C
|
46
|
+
|
47
|
+
Offenses:
|
48
|
+
|
49
|
+
spec/fixtures/dummy.haml:1:13: C: [Correctable] Style/CharacterLiteral: Do not use the character literal - use string literal instead.
|
50
|
+
%div(a="b #{?c}")
|
51
|
+
^^
|
52
|
+
spec/fixtures/dummy.haml:2:7: C: [Correctable] Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
|
53
|
+
%div{ :a => "b" }
|
54
|
+
^^^^^
|
55
|
+
spec/fixtures/dummy.haml:2:13: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
56
|
+
%div{ :a => "b" }
|
57
|
+
^^^
|
58
|
+
|
59
|
+
1 file inspected, 3 offenses detected, 3 offenses auto-correctable
|
60
|
+
```
|
@@ -59,12 +59,10 @@ module Hamlcop
|
|
59
59
|
def traverse(node, &block)
|
60
60
|
return unless node.instance_of?(::Array)
|
61
61
|
|
62
|
-
if node[0] == :hamli && node[1] == :position
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
traverse(element, &block)
|
67
|
-
end
|
62
|
+
block.call(node[2], node[3]) if node[0] == :hamli && node[1] == :position
|
63
|
+
|
64
|
+
node.each do |element|
|
65
|
+
traverse(element, &block)
|
68
66
|
end
|
69
67
|
end
|
70
68
|
end
|
data/lib/hamlcop/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hamlcop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.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: 2022-
|
11
|
+
date: 2022-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hamli
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
description:
|
41
|
+
description:
|
42
42
|
email:
|
43
43
|
- r7kamura@gmail.com
|
44
44
|
executables:
|
@@ -69,7 +69,7 @@ metadata:
|
|
69
69
|
source_code_uri: https://github.com/r7kamura/hamlcop
|
70
70
|
changelog_uri: https://github.com/r7kamura/hamlcop/blob/master/CHANGELOG.md
|
71
71
|
rubygems_mfa_required: 'true'
|
72
|
-
post_install_message:
|
72
|
+
post_install_message:
|
73
73
|
rdoc_options: []
|
74
74
|
require_paths:
|
75
75
|
- lib
|
@@ -84,8 +84,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
|
-
rubygems_version: 3.
|
88
|
-
signing_key:
|
87
|
+
rubygems_version: 3.3.7
|
88
|
+
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: RuboCop runner for Haml template.
|
91
91
|
test_files: []
|