linters 1.1.1 → 2.0.0

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: 31dd1e13e3c4bb7f0b71631d2b49aa0906405aefc5085c96dfdfea36fa338a3a
4
- data.tar.gz: dc31ce553deb37c91794edb65e9cf9ad28987eab5a9c4e0dd529077c69a18c34
3
+ metadata.gz: 97ba0bafaaff95dd94a4a09ad78167ccfddc394b5567c88ddf19d39deb5f3bc3
4
+ data.tar.gz: 0d10e647ad701f81ae51723c7ddf0f85011ae8020e2d061fb298539f1dfdb4ca
5
5
  SHA512:
6
- metadata.gz: 6e85fc0d744aa6a12709920f2d61766b69ef724c022cb51e9b24de0a0e95a26c98d8cb12a936a77aed023a973058fa137d8b5a8031f9ad74a38195dd47473072
7
- data.tar.gz: 28ef9ee1e287f3db5dd844f8feb46021065145fd6eb719b686f07f0727f72877ddcf1113dd01d2c46c095a8e91fc078f7d885ad5fd396df86ae29303becbdbc2
6
+ metadata.gz: d36c80e6a99968aa8c6661ee8e933f73695734fab3ab7c4c17c8571b08dc5967722b3c84d3588fa60367dbffc2aac25ec7e2e3ad0d0e02bbc89c38050fc97737
7
+ data.tar.gz: 897f957f4e263e3c3818bc2ffd0b94280d3e83ab0fe8927ea77e384fd029c9741e94e003e145fab0918591c59aedc2e9b0e86833b393b35cdd3b88e90b6c8ead
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- linters (1.1.0)
4
+ linters (1.1.1)
5
5
  rake
6
6
 
7
7
  GEM
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/settings.yml'
52
+ config.settings_path = 'config/linter_settings.yml'
53
53
  end
54
54
  ```
55
55
 
56
- Default config/settings.yml:
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:
@@ -1,4 +1,9 @@
1
1
  linters:
2
+ checkers:
3
+ - rubocop
4
+ - reek
5
+ - bundle_audit
6
+ - fasterer
2
7
  rubocop:
3
8
  warnings_number: 0
4
9
  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
- @linters = ENV.fetch('LINTERS_CHECKERS', %i[rubocop reek bundle_audit fasterer])
9
- @settings_path = ENV.fetch('LINTERS_SETTING_PATH', 'config/settings.yml')
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
@@ -1,3 +1,3 @@
1
1
  module Linters
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '2.0.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linters
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - skrinits
@@ -142,7 +142,7 @@ files:
142
142
  - Rakefile
143
143
  - bin/console
144
144
  - bin/setup
145
- - config/settings.yml
145
+ - config/linter_settings.yml
146
146
  - lib/linters.rb
147
147
  - lib/linters/builder.rb
148
148
  - lib/linters/configuration.rb