diff options
author | Markus Doits <markus.doits@stellenticket.de> | 2018-03-30 19:20:57 +0200 |
---|---|---|
committer | Markus Doits <markus.doits@stellenticket.de> | 2018-03-30 19:21:22 +0200 |
commit | 0ab4d181c9d2e1ad9e3d4028223f947599781351 (patch) | |
tree | 67e9d93bcd40527750faa788fa14946d24be5a2e | |
parent | 4a987577795e16e2d477207b8edb124b0716ce1c (diff) | |
download | pronto-hlint-0ab4d181c9d2e1ad9e3d4028223f947599781351.tar.gz pronto-hlint-0ab4d181c9d2e1ad9e3d4028223f947599781351.tar.zst pronto-hlint-0ab4d181c9d2e1ad9e3d4028223f947599781351.zip |
update locally used ruby versiob, lint everything
-rw-r--r-- | .rubocop.yml | 48 | ||||
-rw-r--r-- | .ruby-version | 2 | ||||
-rw-r--r-- | Gemfile | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | Rakefile | 2 | ||||
-rw-r--r-- | lib/pronto/eslint_npm.rb | 8 | ||||
-rw-r--r-- | lib/pronto/eslint_npm/version.rb | 2 | ||||
-rw-r--r-- | pronto-eslint_npm.gemspec | 22 | ||||
-rw-r--r-- | spec/pronto/eslint_spec.rb | 2 | ||||
-rw-r--r-- | spec/spec_helper.rb | 4 |
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 | --- | ||
1 | AllCops: | 2 | AllCops: |
2 | DisplayCopNames: true | 3 | DisplayCopNames: true |
3 | DisplayStyleGuide: true | 4 | DisplayStyleGuide: true |
5 | TargetRubyVersion: 2.1.0 | ||
4 | 6 | ||
5 | Documentation: | 7 | Documentation: |
6 | Enabled: false | 8 | Enabled: false |
7 | 9 | ||
8 | Metrics/MethodLength: | 10 | Layout/ExtraSpacing: |
9 | Max: 20 | 11 | ForceEqualSignAlignment: true |
10 | 12 | ||
11 | Metrics/LineLength: | 13 | Layout/MultilineMethodCallIndentation: |
12 | Max: 100 | 14 | Enabled: false |
15 | |||
16 | Lint/AmbiguousBlockAssociation: | ||
17 | Enabled: false | ||
13 | 18 | ||
14 | Metrics/AbcSize: | 19 | Metrics/AbcSize: |
15 | Max: 20 | 20 | Max: 40 |
21 | |||
22 | Metrics/BlockLength: | ||
23 | Enabled: false | ||
24 | |||
25 | Metrics/ClassLength: | ||
26 | Max: 200 | ||
27 | |||
28 | Metrics/CyclomaticComplexity: | ||
29 | Max: 15 | ||
30 | |||
31 | Metrics/LineLength: | ||
32 | Max: 120 | ||
33 | |||
34 | Metrics/MethodLength: | ||
35 | Max: 30 | ||
16 | 36 | ||
17 | Metrics/ParameterLists: | 37 | Metrics/ParameterLists: |
18 | Max: 10 | 38 | Max: 10 |
39 | |||
40 | Rails: | ||
41 | Enabled: true | ||
42 | |||
43 | Rails/InverseOf: | ||
44 | Enabled: false | ||
45 | |||
46 | Rails/LexicallyScopedActionFilter: | ||
47 | Enabled: false | ||
48 | |||
49 | Rails/SkipsModelValidations: | ||
50 | Enabled: false | ||
51 | |||
52 | Rails/UnknownEnv: | ||
53 | Enabled: false | ||
54 | |||
55 | Style/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 | ||
@@ -1,3 +1,5 @@ | |||
1 | # frozen_string_literal: true | ||
2 | |||
1 | source 'https://rubygems.org' | 3 | source 'https://rubygems.org' |
2 | 4 | ||
3 | gemspec | 5 | gemspec |
@@ -1,4 +1,6 @@ | |||
1 | #!/usr/bin/env rake | 1 | #!/usr/bin/env rake |
2 | # frozen_string_literal: true | ||
3 | |||
2 | require 'bundler' | 4 | require 'bundler' |
3 | require 'rspec/core/rake_task' | 5 | require '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 | |||
1 | require 'pronto' | 3 | require 'pronto' |
2 | require 'shellwords' | 4 | require 'shellwords' |
3 | 5 | ||
4 | module Pronto | 6 | module 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 | |||
1 | module Pronto | 3 | module 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__) |
4 | require 'pronto/eslint_npm/version' | 4 | require 'pronto/eslint_npm/version' |
5 | 5 | ||
6 | Gem::Specification.new do |s| | 6 | Gem::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') | ||
29 | end | 29 | end |
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 | |||
1 | require 'spec_helper' | 3 | require 'spec_helper' |
2 | 4 | ||
3 | module Pronto | 5 | module 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 | |||
1 | require 'fileutils' | 3 | require 'fileutils' |
2 | require 'byebug' | 4 | require 'byebug' |
3 | require 'rspec' | 5 | require 'rspec' |
4 | require 'pronto/eslint_npm' | 6 | require '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" } |