erb_lint 0.0.29 → 0.0.30

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
  SHA256:
3
- metadata.gz: e4a94b402b5b0e78c8597154a55807ab0cdab042b02aa105f8a84e7a800d1f78
4
- data.tar.gz: 211323032036eee8cdc61c866d3d3049a80d8ddcf16c2e00795e8955dd8b112e
3
+ metadata.gz: b136922bb523d860a4167f2ee6a896c332bf083bbf88fcb30ea983cd28ad1ed5
4
+ data.tar.gz: 145bd0a1217c31f9e4ccd7221548fef987910c4f026c221fb89fa65b8834d7d7
5
5
  SHA512:
6
- metadata.gz: 7721c096adf5dc25e919a1f233292d393bfb005c14bd90e4271a191313fefc5ee6c6e64d625c3f5bac39fccb5eeba42d6fd1cb64c99c069a03cf7c2a64d7fe1b
7
- data.tar.gz: b7e7f1f7fbfab896f3ade2708cf873a19c05011b76be978df594326b47d999d27692a0afaeb9d296395a2dc09678ee4008fbf06abed8cad2c4901dad1a071152
6
+ metadata.gz: f3bba6099a1aaf0402d046d0f6acc0a7e17af7d0ca1a05883ae9b6016cf79d141f54976974e5a7035b60cb257f123434c49447c870fdda0a699d1ae62de158cb
7
+ data.tar.gz: fdab81ad466f3407ca177f60fe727ed7c760c82448d5ba009722fc04175c89f28dc9b43875a90c4c75df600eef0607c7aa7fbdca1da85d1f262cf970cec9cab0
@@ -17,10 +17,11 @@ module ERBLint
17
17
  class ExitWithSuccess < RuntimeError; end
18
18
 
19
19
  class Stats
20
- attr_accessor :found, :corrected
20
+ attr_accessor :found, :corrected, :exceptions
21
21
  def initialize
22
22
  @found = 0
23
23
  @corrected = 0
24
+ @exceptions = 0
24
25
  end
25
26
  end
26
27
 
@@ -57,7 +58,10 @@ module ERBLint
57
58
  begin
58
59
  run_with_corrections(filename)
59
60
  rescue => e
61
+ @stats.exceptions += 1
60
62
  puts "Exception occured when processing: #{relative_filename(filename)}"
63
+ puts "If this file cannot be processed by erb-lint, "\
64
+ "you can exclude it in your configuration file."
61
65
  puts e.message
62
66
  puts Rainbow(e.backtrace.join("\n")).red
63
67
  puts
@@ -79,7 +83,7 @@ module ERBLint
79
83
  puts Rainbow("No errors were found in ERB files").green
80
84
  end
81
85
 
82
- @stats.found == 0
86
+ @stats.found == 0 && @stats.exceptions == 0
83
87
  rescue OptionParser::InvalidOption, OptionParser::InvalidArgument, ExitWithFailure => e
84
88
  warn(Rainbow(e.message).red)
85
89
  false
@@ -98,7 +102,7 @@ module ERBLint
98
102
  end
99
103
 
100
104
  def run_with_corrections(filename)
101
- file_content = File.read(filename)
105
+ file_content = File.read(filename, encoding: Encoding::UTF_8)
102
106
 
103
107
  runner = ERBLint::Runner.new(file_loader, @config)
104
108
 
@@ -108,10 +108,8 @@ module ERBLint
108
108
  if @only_cops.present?
109
109
  selected_cops = RuboCop::Cop::Cop.all.select { |cop| cop.match?(@only_cops) }
110
110
  RuboCop::Cop::Registry.new(selected_cops)
111
- elsif @rubocop_config['Rails']['Enabled']
112
- RuboCop::Cop::Registry.new(RuboCop::Cop::Cop.all)
113
111
  else
114
- RuboCop::Cop::Cop.non_rails
112
+ RuboCop::Cop::Registry.new(RuboCop::Cop::Cop.all)
115
113
  end
116
114
  end
117
115
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ERBLint
4
- VERSION = '0.0.29'
4
+ VERSION = '0.0.30'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erb_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.29
4
+ version: 0.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Chan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-03 00:00:00.000000000 Z
11
+ date: 2019-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: better_html
@@ -176,15 +176,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - ">="
178
178
  - !ruby/object:Gem::Version
179
- version: 2.3.0
179
+ version: 2.4.0
180
180
  required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  requirements:
182
182
  - - ">="
183
183
  - !ruby/object:Gem::Version
184
184
  version: '0'
185
185
  requirements: []
186
- rubyforge_project:
187
- rubygems_version: 2.7.6
186
+ rubygems_version: 3.0.3
188
187
  signing_key:
189
188
  specification_version: 4
190
189
  summary: ERB lint tool