aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.rubocop.yml48
-rw-r--r--.ruby-version2
-rw-r--r--Gemfile2
-rwxr-xr-x[-rw-r--r--]Rakefile2
-rw-r--r--lib/pronto/eslint_npm.rb8
-rw-r--r--lib/pronto/eslint_npm/version.rb2
-rw-r--r--pronto-eslint_npm.gemspec22
-rw-r--r--spec/pronto/eslint_spec.rb2
-rw-r--r--spec/spec_helper.rb4
9 files changed, 71 insertions, 21 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 33ec248..393726b 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,18 +1,56 @@
1---
1AllCops: 2AllCops:
2 DisplayCopNames: true 3 DisplayCopNames: true
3 DisplayStyleGuide: true 4 DisplayStyleGuide: true
5 TargetRubyVersion: 2.1.0
4 6
5Documentation: 7Documentation:
6 Enabled: false 8 Enabled: false
7 9
8Metrics/MethodLength: 10Layout/ExtraSpacing:
9 Max: 20 11 ForceEqualSignAlignment: true
10 12
11Metrics/LineLength: 13Layout/MultilineMethodCallIndentation:
12 Max: 100 14 Enabled: false
15
16Lint/AmbiguousBlockAssociation:
17 Enabled: false
13 18
14Metrics/AbcSize: 19Metrics/AbcSize:
15 Max: 20 20 Max: 40
21
22Metrics/BlockLength:
23 Enabled: false
24
25Metrics/ClassLength:
26 Max: 200
27
28Metrics/CyclomaticComplexity:
29 Max: 15
30
31Metrics/LineLength:
32 Max: 120
33
34Metrics/MethodLength:
35 Max: 30
16 36
17Metrics/ParameterLists: 37Metrics/ParameterLists:
18 Max: 10 38 Max: 10
39
40Rails:
41 Enabled: true
42
43Rails/InverseOf:
44 Enabled: false
45
46Rails/LexicallyScopedActionFilter:
47 Enabled: false
48
49Rails/SkipsModelValidations:
50 Enabled: false
51
52Rails/UnknownEnv:
53 Enabled: false
54
55Style/FormatStringToken:
56 Enabled: false
diff --git a/.ruby-version b/.ruby-version
index 0bee604..73462a5 100644
--- a/.ruby-version
+++ b/.ruby-version
@@ -1 +1 @@
2.3.3 2.5.1
diff --git a/Gemfile b/Gemfile
index fa75df1..7f4f5e9 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,3 +1,5 @@
1# frozen_string_literal: true
2
1source 'https://rubygems.org' 3source 'https://rubygems.org'
2 4
3gemspec 5gemspec
diff --git a/Rakefile b/Rakefile
index dfa86a6..fcf8b82 100644..100755
--- a/Rakefile
+++ b/Rakefile
@@ -1,4 +1,6 @@
1#!/usr/bin/env rake 1#!/usr/bin/env rake
2# frozen_string_literal: true
3
2require 'bundler' 4require 'bundler'
3require 'rspec/core/rake_task' 5require 'rspec/core/rake_task'
4 6
diff --git a/lib/pronto/eslint_npm.rb b/lib/pronto/eslint_npm.rb
index bb79091..e861ffe 100644
--- a/lib/pronto/eslint_npm.rb
+++ b/lib/pronto/eslint_npm.rb
@@ -1,15 +1,17 @@
1# frozen_string_literal: true
2
1require 'pronto' 3require 'pronto'
2require 'shellwords' 4require 'shellwords'
3 5
4module Pronto 6module Pronto
5 class ESLintNpm < Runner 7 class ESLintNpm < Runner
6 CONFIG_FILE = '.pronto_eslint_npm.yml'.freeze 8 CONFIG_FILE = '.pronto_eslint_npm.yml'.freeze
7 CONFIG_KEYS = %w(eslint_executable files_to_lint).freeze 9 CONFIG_KEYS = %w[eslint_executable files_to_lint].freeze
8 10
9 attr_writer :eslint_executable 11 attr_writer :eslint_executable
10 12
11 def eslint_executable 13 def eslint_executable
12 @eslint_executable || 'eslint'.freeze 14 @eslint_executable || 'eslint'
13 end 15 end
14 16
15 def files_to_lint 17 def files_to_lint
@@ -61,7 +63,7 @@ module Pronto
61 end 63 end
62 64
63 def new_message(offence, line) 65 def new_message(offence, line)
64 path = line.patch.delta.new_file[:path] 66 path = line.patch.delta.new_file[:path]
65 level = :warning 67 level = :warning
66 68
67 Message.new(path, line, level, offence['message'], nil, self.class) 69 Message.new(path, line, level, offence['message'], nil, self.class)
diff --git a/lib/pronto/eslint_npm/version.rb b/lib/pronto/eslint_npm/version.rb
index c22ce28..2d3f9d8 100644
--- a/lib/pronto/eslint_npm/version.rb
+++ b/lib/pronto/eslint_npm/version.rb
@@ -1,3 +1,5 @@
1# frozen_string_literal: true
2
1module Pronto 3module Pronto
2 module ESLintNpmVersion 4 module ESLintNpmVersion
3 VERSION = '0.9.0'.freeze 5 VERSION = '0.9.0'.freeze
diff --git a/pronto-eslint_npm.gemspec b/pronto-eslint_npm.gemspec
index d3e3b65..2304678 100644
--- a/pronto-eslint_npm.gemspec
+++ b/pronto-eslint_npm.gemspec
@@ -1,29 +1,29 @@
1# -*- encoding: utf-8 -*- 1# frozen_string_literal: true
2 2
3$LOAD_PATH.push File.expand_path('../lib', __FILE__) 3$LOAD_PATH.push File.expand_path('lib', __dir__)
4require 'pronto/eslint_npm/version' 4require 'pronto/eslint_npm/version'
5 5
6Gem::Specification.new do |s| 6Gem::Specification.new do |s|
7 s.name = 'pronto-eslint_npm' 7 s.name = 'pronto-eslint_npm'
8 s.version = Pronto::ESLintNpmVersion::VERSION 8 s.version = Pronto::ESLintNpmVersion::VERSION
9 s.platform = Gem::Platform::RUBY 9 s.platform = Gem::Platform::RUBY
10 s.authors = ['Markus Doits', 'Mindaugas Mozūras'] 10 s.authors = ['Markus Doits', 'Mindaugas Mozūras']
11 s.email = 'markus.doits@gmail.com' 11 s.email = 'markus.doits@gmail.com'
12 s.homepage = 'https://github.com/doits/pronto-eslint_npm' 12 s.homepage = 'https://github.com/doits/pronto-eslint_npm'
13 s.summary = <<-EOF 13 s.summary = <<-EOF
14 Pronto runner for ESLint, pluggable linting utility for JavaScript and JSX 14 Pronto runner for ESLint, pluggable linting utility for JavaScript and JSX
15 EOF 15 EOF
16 16
17 s.licenses = ['MIT'] 17 s.licenses = ['MIT']
18 s.required_ruby_version = '>= 2.0.0' 18 s.required_ruby_version = '>= 2.0.0'
19 19
20 s.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(lib/|(LICENSE|README.md)$)}) } 20 s.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(lib/|(LICENSE|README.md)$)}) }
21 s.extra_rdoc_files = ['LICENSE', 'README.md'] 21 s.extra_rdoc_files = ['LICENSE', 'README.md']
22 s.require_paths = ['lib'] 22 s.require_paths = ['lib']
23 s.requirements << 'eslint (in PATH)' 23 s.requirements << 'eslint (in PATH)'
24 24
25 s.add_dependency('pronto', '~> 0.9.1') 25 s.add_dependency('pronto', '~> 0.9.1')
26 s.add_development_dependency('byebug', '>= 9')
26 s.add_development_dependency('rake', '>= 11.0', '< 13') 27 s.add_development_dependency('rake', '>= 11.0', '< 13')
27 s.add_development_dependency('rspec', '~> 3.4') 28 s.add_development_dependency('rspec', '~> 3.4')
28 s.add_development_dependency('byebug', '>= 9')
29end 29end
diff --git a/spec/pronto/eslint_spec.rb b/spec/pronto/eslint_spec.rb
index b0b9c22..52e52f2 100644
--- a/spec/pronto/eslint_spec.rb
+++ b/spec/pronto/eslint_spec.rb
@@ -1,3 +1,5 @@
1# frozen_string_literal: true
2
1require 'spec_helper' 3require 'spec_helper'
2 4
3module Pronto 5module Pronto
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index c13fe98..b3d8596 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,9 +1,11 @@
1# frozen_string_literal: true
2
1require 'fileutils' 3require 'fileutils'
2require 'byebug' 4require 'byebug'
3require 'rspec' 5require 'rspec'
4require 'pronto/eslint_npm' 6require 'pronto/eslint_npm'
5 7
6%w(test eslintignore).each do |repo_name| 8%w[test eslintignore].each do |repo_name|
7 RSpec.shared_context "#{repo_name} repo" do 9 RSpec.shared_context "#{repo_name} repo" do
8 let(:git) { "spec/fixtures/#{repo_name}.git/git" } 10 let(:git) { "spec/fixtures/#{repo_name}.git/git" }
9 let(:dot_git) { "spec/fixtures/#{repo_name}.git/.git" } 11 let(:dot_git) { "spec/fixtures/#{repo_name}.git/.git" }