aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMindaugas Mozūras <mindaugas.mozuras@gmail.com>2016-03-14 23:08:08 +0200
committerMindaugas Mozūras <mindaugas.mozuras@gmail.com>2016-03-14 23:08:08 +0200
commitb338a7ad2866cec61a0409fc0745c18d8883d9c8 (patch)
tree8114f644ee40ef58e20f9185ce269c3a0e15d2dd
parentdb8f1f434e7ffc9f57eef0758a19e9ad63dab827 (diff)
downloadpronto-hlint-b338a7ad2866cec61a0409fc0745c18d8883d9c8.tar.gz
pronto-hlint-b338a7ad2866cec61a0409fc0745c18d8883d9c8.tar.zst
pronto-hlint-b338a7ad2866cec61a0409fc0745c18d8883d9c8.zip
Depend on newest versions of pronto and eslint (less strictly)
-rw-r--r--lib/pronto/eslint.rb8
-rw-r--r--pronto-eslint.gemspec8
-rw-r--r--spec/pronto/eslint_spec.rb4
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/pronto/eslint.rb b/lib/pronto/eslint.rb
index 67e9229..b6ccff1 100644
--- a/lib/pronto/eslint.rb
+++ b/lib/pronto/eslint.rb
@@ -3,10 +3,10 @@ require 'eslintrb'
3 3
4module Pronto 4module Pronto
5 class ESLint < Runner 5 class ESLint < Runner
6 def run(patches, _) 6 def run
7 return [] unless patches 7 return [] unless @patches
8 8
9 patches.select { |patch| patch.additions > 0 } 9 @patches.select { |patch| patch.additions > 0 }
10 .select { |patch| js_file?(patch.new_file_full_path) } 10 .select { |patch| js_file?(patch.new_file_full_path) }
11 .map { |patch| inspect(patch) } 11 .map { |patch| inspect(patch) }
12 .flatten.compact 12 .flatten.compact
@@ -26,7 +26,7 @@ module Pronto
26 path = line.patch.delta.new_file[:path] 26 path = line.patch.delta.new_file[:path]
27 level = :warning 27 level = :warning
28 28
29 Message.new(path, line, level, offence['message']) 29 Message.new(path, line, level, offence['message'], nil, self.class)
30 end 30 end
31 31
32 def js_file?(path) 32 def js_file?(path)
diff --git a/pronto-eslint.gemspec b/pronto-eslint.gemspec
index 7a57560..77da780 100644
--- a/pronto-eslint.gemspec
+++ b/pronto-eslint.gemspec
@@ -34,9 +34,9 @@ Gem::Specification.new do |s|
34 s.extra_rdoc_files = ['LICENSE', 'README.md'] 34 s.extra_rdoc_files = ['LICENSE', 'README.md']
35 s.require_paths = ['lib'] 35 s.require_paths = ['lib']
36 36
37 s.add_dependency('pronto', '~> 0.5.0') 37 s.add_dependency('pronto', '~> 0.6.0')
38 s.add_dependency('eslintrb', '~> 2.0.0') 38 s.add_dependency('eslintrb', '~> 2.0', '>= 2.0.0')
39 s.add_development_dependency('rake', '~> 10.4') 39 s.add_development_dependency('rake', '~> 11.0')
40 s.add_development_dependency('rspec', '~> 3.3') 40 s.add_development_dependency('rspec', '~> 3.4')
41 s.add_development_dependency('rspec-its', '~> 1.2') 41 s.add_development_dependency('rspec-its', '~> 1.2')
42end 42end
diff --git a/spec/pronto/eslint_spec.rb b/spec/pronto/eslint_spec.rb
index 8bd0bc8..29d46e4 100644
--- a/spec/pronto/eslint_spec.rb
+++ b/spec/pronto/eslint_spec.rb
@@ -2,10 +2,10 @@ require 'spec_helper'
2 2
3module Pronto 3module Pronto
4 describe ESLint do 4 describe ESLint do
5 let(:eslint) { ESLint.new } 5 let(:eslint) { ESLint.new(patches) }
6 6
7 describe '#run' do 7 describe '#run' do
8 subject { eslint.run(patches, nil) } 8 subject { eslint.run }
9 9
10 context 'patches are nil' do 10 context 'patches are nil' do
11 let(:patches) { nil } 11 let(:patches) { nil }