linters 1.1.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +7 -2
- data/config/{settings.yml → linter_settings.yml} +5 -0
- data/lib/linters/configuration.rb +12 -2
- data/lib/linters/linter_settings.rb +2 -2
- data/lib/linters/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a559b44af47629a4611187a2c524cb3dd2cb0d6ef8b4aeb16dbe75b7fdf0ce64
|
4
|
+
data.tar.gz: fa688a4549d7766f2ff664d112598b9dd74cdd0928f5966bca670535d75ceb0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9b627626fcff7b5d72c74ab99c71eb69a7d9230f8c2902a3597134f0091abd32773dc5549bc0d5483e58fd2529b58e1eb515a9abfcb6b13df56b8af24eba330
|
7
|
+
data.tar.gz: de39b2917ac97a0e9815a1e51d60680af74f03b0e146e059d2d321bfef4b82dab8de3f023e78746eb394f7f688622b987cdf9646bc0e18506c6fbe24b5905b37
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -49,13 +49,18 @@ Settings with default values:
|
|
49
49
|
Linters.configure do |config|
|
50
50
|
config.custom_linters = {}
|
51
51
|
config.linters = %i[rubocop reek bundle_audit fasterer]
|
52
|
-
config.settings_path = 'config/
|
52
|
+
config.settings_path = 'config/linter_settings.yml'
|
53
53
|
end
|
54
54
|
```
|
55
55
|
|
56
|
-
Default config/
|
56
|
+
Default config/linter_settings.yml:
|
57
57
|
|
58
58
|
```
|
59
|
+
checkers:
|
60
|
+
- rubocop
|
61
|
+
- reek
|
62
|
+
- bundle_audit
|
63
|
+
- fasterer
|
59
64
|
rubocop:
|
60
65
|
warnings_number: 0
|
61
66
|
reek:
|
@@ -3,10 +3,20 @@ module Linters
|
|
3
3
|
# :reek:Attribute
|
4
4
|
attr_accessor :custom_linters, :linters, :settings_path
|
5
5
|
|
6
|
+
DEFAULT_CHECKERS = %i[rubocop reek bundle_audit fasterer].freeze
|
7
|
+
|
6
8
|
def initialize
|
7
9
|
@custom_linters = {}
|
8
|
-
@
|
9
|
-
@
|
10
|
+
@settings_path = ENV.fetch('LINTERS_SETTING_PATH', 'config/linter_settings.yml')
|
11
|
+
@linters = ENV.fetch('LINTERS_CHECKERS', load_checkers(@settings_path))
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def load_checkers(path)
|
17
|
+
return DEFAULT_CHECKERS unless File.exist?(path)
|
18
|
+
|
19
|
+
(YAML.load_file(path)['linters']['checkers'] || DEFAULT_CHECKERS).map(&:to_sym)
|
10
20
|
end
|
11
21
|
end
|
12
22
|
end
|
@@ -23,7 +23,7 @@ module Linters
|
|
23
23
|
parse_output: ->(output) { JSON.parse(output).size }
|
24
24
|
},
|
25
25
|
rubocop: {
|
26
|
-
default_command: 'rubocop --format json',
|
26
|
+
default_command: 'rubocop --parallel --format json',
|
27
27
|
parse_output: ->(output) { JSON.parse(output)['summary']['offense_count'] }
|
28
28
|
}
|
29
29
|
}.freeze
|
@@ -39,7 +39,7 @@ module Linters
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def warnings_number
|
42
|
-
settings.fetch(:warnings_number) { 0 }
|
42
|
+
ENV.fetch("LINTERS_#{ name.upcase }_NUMBER_WARNINGS", settings.fetch(:warnings_number) { 0 })
|
43
43
|
end
|
44
44
|
|
45
45
|
def command
|
data/lib/linters/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- skrinits
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -142,7 +142,7 @@ files:
|
|
142
142
|
- Rakefile
|
143
143
|
- bin/console
|
144
144
|
- bin/setup
|
145
|
-
- config/
|
145
|
+
- config/linter_settings.yml
|
146
146
|
- lib/linters.rb
|
147
147
|
- lib/linters/builder.rb
|
148
148
|
- lib/linters/configuration.rb
|