erb_lint 0.0.25 → 0.0.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e1b8cceb3cf2f8ce26f00e26d3afb41f77e4712
4
- data.tar.gz: f93a0469e26dd724f75e9ad5d43b0447a280aa19
3
+ metadata.gz: 82be0f658ce3baab1198821bebab48ed006b10be
4
+ data.tar.gz: b7362a45f4b3a1c33f2fcc5be16c147fce73e04d
5
5
  SHA512:
6
- metadata.gz: da97d904c02d413663e404653f4bc813bfa345cba6822b460332cb4850157c95dfe8c6443a81ff1ee6a406de12dc75d8eae3335591c74347f00e3951a4ddc6ea
7
- data.tar.gz: b70ac728ed6f038bce0761bc24676d07960ff68662db7a39fff64fe903bc4bd7f92e7d13a84a01f668352532d6e42b6d78cdf08d787b384c74dcc8f2dad17eb2
6
+ metadata.gz: bb77c4fb3259e5bf91f6881cd573c328959c79c931ac5e8b1a589050a74d8b3167e651df93d40340f2080532f1121d65eddf4d6d8ef481a93d92e61d744e76d8
7
+ data.tar.gz: efabfee67363da1cd91591d7acd37098c06ae51da74e1d12a653e0d02965c82c5b996b839f2ba3c823830b7063ea6ee512ed16c73b6c063f3a98639f9f90f646
@@ -13,14 +13,16 @@ module ERBLint
13
13
 
14
14
  def run(processed_source)
15
15
  processed_source.ast.descendants(:erb).each do |erb_node|
16
- indicator, ltrim, code_node, rtrim = *erb_node
16
+ indicator_node, ltrim, code_node, rtrim = *erb_node
17
+ indicator = indicator_node&.loc&.source
18
+ next if indicator == '#' || indicator == '%'
17
19
  code = code_node.children.first
18
20
 
19
21
  start_spaces = code.match(START_SPACES)&.captures&.first || ""
20
22
  if start_spaces.size != 1 && !start_spaces.include?("\n")
21
23
  add_offense(
22
24
  code_node.loc.resize(start_spaces.size),
23
- "Use 1 space after `<%#{indicator&.loc&.source}#{ltrim&.loc&.source}` "\
25
+ "Use 1 space after `<%#{indicator}#{ltrim&.loc&.source}` "\
24
26
  "instead of #{start_spaces.size} space#{'s' if start_spaces.size > 1}.",
25
27
  ' '
26
28
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ERBLint
4
- VERSION = '0.0.25'
4
+ VERSION = '0.0.26'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erb_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.25
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Chan