haml_lint 0.34.2 → 0.35.0

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
  SHA256:
3
- metadata.gz: bb14c47d0a3ed83deb2fec7f1e91b5caaba391a4bf2f1f6a72269b1e1d56e759
4
- data.tar.gz: 493220080a38c3c6866123cc0c82a31a3904003213b210b453d14dc629a69ec2
3
+ metadata.gz: 85d02f79b2988c1c3be9c98affa2dca57e3f52751d140191e8e3654f86ed7d3f
4
+ data.tar.gz: f5c798d7646ee43da478a2a20bf310dc0cb7949061b3bcf243e94ee7ea173e2c
5
5
  SHA512:
6
- metadata.gz: f97c133d7de22e5f7a4ff64408e1ad3f3c3d43c818876649d623aed27da0ed06c3e8b390924f401c30b9d46208295271c719c46722095233f671435fc1ef9a3d
7
- data.tar.gz: 8bca0d77ec6699d7f94f28fc1c539ddfb1298c98c4c06f588c4e81a9946c162b0ec0cfb2b983bdeb68f2b4daf6ec0ee3cf5ecd3aef32529a55b3daa9ac2ad303
6
+ metadata.gz: c902d2c3a8586d5595096fe2e1907a045313594d032ea0fa074f2b6398822a3228d41ff007b5f77296f3cf541ec65d2206bfc5e7350c132be9b0535f1066b29c
7
+ data.tar.gz: 42ab15c490582e03eb40f10883da0b697abafe78c3976f121945bc0a3a794309cd4faccf7df23c8066aa0ca20f2d4f00fb75c0b74e70e75ee7882101691461bb
@@ -56,7 +56,12 @@ module HamlLint
56
56
  # @param file [String]
57
57
  # @return [Array<RuboCop::Cop::Offense>]
58
58
  def lint_file(rubocop, file)
59
- rubocop.run(rubocop_flags << file)
59
+ status = rubocop.run(rubocop_flags << file)
60
+ unless [::RuboCop::CLI::STATUS_SUCCESS, ::RuboCop::CLI::STATUS_OFFENSES].include?(status)
61
+ raise HamlLint::Exceptions::ConfigurationError,
62
+ "RuboCop exited unsuccessfully with status #{status}." \
63
+ ' Check the stack trace to see if there was a misconfiguration.'
64
+ end
60
65
  OffenseCollector.offenses
61
66
  end
62
67
 
@@ -43,7 +43,7 @@ module HamlLint
43
43
  # given special treatment, thus making enclosing it in a string necessary.
44
44
  def starts_with_reserved_character?(stringish)
45
45
  string = stringish.respond_to?(:children) ? stringish.children.first : stringish
46
- string =~ %r{\A\s*[/#-=%~]}
46
+ string =~ %r{\A\s*[/#-=%~]} if string.is_a?(String)
47
47
  end
48
48
  end
49
49
  end
@@ -17,7 +17,9 @@ module HamlLint::Tree
17
17
  # @param line [Integer] the line number of the node
18
18
  # @return [HamlLint::Node]
19
19
  def node_for_line(line)
20
- find(-> { HamlLint::Tree::NullNode.new }) { |node| node.line_numbers.cover?(line) }
20
+ find(-> { HamlLint::Tree::NullNode.new }) do |node|
21
+ node.line_numbers.cover?(line) && node != self
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  module HamlLint
5
- VERSION = '0.34.2'
5
+ VERSION = '0.35.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haml_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.2
4
+ version: 0.35.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane da Silva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-05 00:00:00.000000000 Z
11
+ date: 2020-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: haml