granite 1.0.0 → 1.1.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: b350a3ec5e67ddb8963e53fd5662b907281bd99ae80bf2c56d1e38bc5aab1e91
4
- data.tar.gz: e50e8205ed1c15b743c19162a707aaeb9e22aa56956b7cfc468c9c2ddaba9211
3
+ metadata.gz: b5b0fbb3a452b278fc48f954b8f05367a8ede9446e302c1b3a9deb60c8a35cae
4
+ data.tar.gz: 81b02115112d340abfb5bbb097ffee571cee9e6171c70da575e6d7af31d24ff8
5
5
  SHA512:
6
- metadata.gz: e0bd294852f36a6e3995cc8bd2637093be985032d32645350f04fdad67c6897dafde07770ec53f720af43bb7b6470fe59643a3ba4784d97a829e35c8bc609fc7
7
- data.tar.gz: 15c8c6b16d6514fd6b3699e99615e06b1f2ee523cd978bb3725891c969a991f81e72fba821d5e52064a4afe48c4875fd4aa4c77a5e499eb03f69b103a678b874
6
+ metadata.gz: a44c19051bb35dc1e50498ae8ec8c640b2dbdca5f0f108de591c140c6bd626ea03cb1ab4e2b834cd5e71e3b3041e53386f6aa8c3d09634c720ac8314b26092be
7
+ data.tar.gz: 2d9b15191e799d152fb890a6addbaf2f8fac6e6fafcff8bf939e50003ed8fa8dc45edad8b98ea2c7bccde82831396eb5a5dee5027c9a5d988f480f9179db745f
@@ -1,3 +1,3 @@
1
1
  module Granite
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.1.0'.freeze
3
3
  end
@@ -0,0 +1,32 @@
1
+ require 'lint_roller'
2
+ require 'granite/version'
3
+
4
+ module RuboCop
5
+ module Granite
6
+ # Plugin integration for RuboCop's plugin system (1.72+).
7
+ class Plugin < LintRoller::Plugin
8
+ def about
9
+ LintRoller::About.new(
10
+ name: 'rubocop-granite',
11
+ version: ::Granite::VERSION,
12
+ homepage: 'https://github.com/toptal/granite',
13
+ description: 'Custom RuboCop configuration for Granite'
14
+ )
15
+ end
16
+
17
+ def supported?(context)
18
+ context.engine == :rubocop
19
+ end
20
+
21
+ def rules(_context)
22
+ project_root = Pathname.new(__dir__).parent.parent.parent.expand_path
23
+
24
+ LintRoller::Rules.new(
25
+ type: :path,
26
+ config_format: :rubocop,
27
+ value: project_root.join('config', 'rubocop-default.yml').to_s
28
+ )
29
+ end
30
+ end
31
+ end
32
+ end
@@ -1,9 +1,4 @@
1
1
  module RuboCop
2
2
  module Granite # :nodoc:
3
- PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
4
- CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'rubocop-default.yml').freeze
5
- CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
6
-
7
- private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
8
3
  end
9
4
  end
@@ -1,6 +1,4 @@
1
1
  require 'rubocop'
2
2
 
3
3
  require_relative 'rubocop/granite'
4
- require_relative 'rubocop/granite/inject'
5
-
6
- RuboCop::Granite::Inject.defaults!
4
+ require_relative 'rubocop/granite/plugin'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: granite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toptal Engineering
@@ -225,14 +225,14 @@ dependencies:
225
225
  requirements:
226
226
  - - ">="
227
227
  - !ruby/object:Gem::Version
228
- version: '0'
228
+ version: 1.72.1
229
229
  type: :development
230
230
  prerelease: false
231
231
  version_requirements: !ruby/object:Gem::Requirement
232
232
  requirements:
233
233
  - - ">="
234
234
  - !ruby/object:Gem::Version
235
- version: '0'
235
+ version: 1.72.1
236
236
  - !ruby/object:Gem::Dependency
237
237
  name: rubocop-rails
238
238
  requirement: !ruby/object:Gem::Requirement
@@ -359,11 +359,12 @@ files:
359
359
  - lib/granite/version.rb
360
360
  - lib/rubocop-granite.rb
361
361
  - lib/rubocop/granite.rb
362
- - lib/rubocop/granite/inject.rb
362
+ - lib/rubocop/granite/plugin.rb
363
363
  homepage: https://github.com/toptal/granite
364
364
  licenses:
365
365
  - MIT
366
366
  metadata:
367
+ default_lint_roller_plugin: RuboCop::Granite::Plugin
367
368
  rubygems_mfa_required: 'true'
368
369
  rdoc_options: []
369
370
  require_paths:
@@ -379,7 +380,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
379
380
  - !ruby/object:Gem::Version
380
381
  version: '0'
381
382
  requirements: []
382
- rubygems_version: 3.6.9
383
+ rubygems_version: 4.0.9
383
384
  specification_version: 4
384
385
  summary: Another business actions architecture for Rails apps
385
386
  test_files: []
@@ -1,18 +0,0 @@
1
- # The original code is from https://github.com/rubocop-hq/rubocop-rspec/blob/master/lib/rubocop/rspec/inject.rb
2
- # See https://github.com/rubocop-hq/rubocop-rspec/blob/master/MIT-LICENSE.md
3
- module RuboCop
4
- module Granite
5
- # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
6
- # bit of our configuration.
7
- module Inject
8
- def self.defaults!
9
- path = CONFIG_DEFAULT.to_s
10
- hash = ConfigLoader.load_file(path)
11
- config = Config.new(hash, path).tap(&:make_excludes_absolute)
12
- Rails.logger.debug { "configuration from #{path}" } if ConfigLoader.debug?
13
- config = ConfigLoader.merge_with_default(config, path)
14
- ConfigLoader.instance_variable_set(:@default_configuration, config)
15
- end
16
- end
17
- end
18
- end