haml_lint 0.18.1 → 0.18.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e62485b5a5cfd611b764d2e83560bc3e81b174f
|
4
|
+
data.tar.gz: 773e5beb63aa9c6759499fab2a7cedc9844d52a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1744cc9bb1276c04f5a35ed795eeb926802554d90c2a963d3315a7fef4877bca03c40a9ba7ac28f9dc02e17d7f678b6696daf6e90a0a5772d5e0b523faadc465
|
7
|
+
data.tar.gz: 08caf5fe8f62593e45bee7fd440236e2aa18f2457076f7a3a4714de3f3f681afe8a7271de32eba89677e30579906898ce6bcb86ef6781984d8ece86811e28751
|
@@ -7,7 +7,9 @@ module HamlLint
|
|
7
7
|
|
8
8
|
MESSAGE_FORMAT = 'The %s symbol should have one space separating it from code'.freeze
|
9
9
|
|
10
|
-
|
10
|
+
ALLOWED_SEPARATORS = [' ', '#'].freeze
|
11
|
+
|
12
|
+
def visit_tag(node) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/LineLength, Metrics/PerceivedComplexity
|
11
13
|
# If this tag has inline script
|
12
14
|
return unless node.contains_script?
|
13
15
|
|
@@ -26,6 +28,8 @@ module HamlLint
|
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
31
|
+
return if tag_with_text[index] == '#' # Ignore code comments
|
32
|
+
|
29
33
|
# Check if the character before the start of the script is a space
|
30
34
|
# (need to do it this way as the parser strips whitespace from node)
|
31
35
|
return unless tag_with_text[index - 1] != ' '
|
@@ -48,7 +52,7 @@ module HamlLint
|
|
48
52
|
|
49
53
|
def missing_space?(node)
|
50
54
|
text = node.script
|
51
|
-
text[0]
|
55
|
+
!ALLOWED_SEPARATORS.include?(text[0]) if text
|
52
56
|
end
|
53
57
|
end
|
54
58
|
end
|
@@ -26,7 +26,8 @@ module HamlLint
|
|
26
26
|
offenses.each do |offense|
|
27
27
|
xml << "<error line=\"#{offense.line}\" severity=\"#{offense.severity}\" "
|
28
28
|
xml << "message=\"#{CGI.escapeHTML offense.message}\" "
|
29
|
-
xml << "source=\"#{offense.linter.name}\"
|
29
|
+
xml << "source=\"#{offense.linter.name}\" " if offense.linter
|
30
|
+
xml << '/>'
|
30
31
|
end
|
31
32
|
xml
|
32
33
|
end
|
data/lib/haml_lint/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haml_lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brigade Engineering
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-08-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: haml
|