rubocop-grape 0.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a10e156b9a117d1d9bd4eb1e3d0c559268669f410d80c786d5c4b38ca79d508
4
- data.tar.gz: '0287d909c47e61e540fcc98edf2303b97f43ebad7a6fc244fa14444661dbc77f'
3
+ metadata.gz: 8c25d3c6a6082d6b275b0e1d9b42ea3e563d268b093ee71f14d778286759e675
4
+ data.tar.gz: 379dc3a6046ce4365fbf5547e969bb121e98d44fb5020f5bcddafc444b116214
5
5
  SHA512:
6
- metadata.gz: f01ca9109f953bc9f7f74bebad5a468004fb9db4b738b4d9e01ef0d9265325159e4d6397d16ca35453b3ae5784df27523e7ceea01413de9f030358b4101d9f4e
7
- data.tar.gz: e1acec347d818fe04be34f01a012ebd7961730091b00cc370aa720e6097a783eb59b5de54bb2aada39f2f21d7b393b1e26e696d56298ce762ba43243fff3d3a3
6
+ metadata.gz: 5de198f343ab30657b1441c0ee038a4685d79435e0f0f6cd13e6c4d946e57e282ecf37f6614a5048bbdae0e4d4a5bf5a24842240bcf121e7e79f52defd0fb09b
7
+ data.tar.gz: 0fc7c0b5e700e381d9e9d8c2d2895f468bc1c3f2f593d4ccec09400e6e8c068d1b335c5093c8763fe1d64ec22e23a91b4f052ae3fdd0c5a20e7748124554c967
data/README.md CHANGED
@@ -26,13 +26,13 @@ ways to do this:
26
26
  Put this into your `.rubocop.yml`.
27
27
 
28
28
  ```yaml
29
- require: rubocop-grape
29
+ plugins: rubocop-grape
30
30
  ```
31
31
 
32
32
  Alternatively, use the following array notation when specifying multiple extensions.
33
33
 
34
34
  ```yaml
35
- require:
35
+ plugins:
36
36
  - rubocop-other-extension
37
37
  - rubocop-grape
38
38
  ```
@@ -40,6 +40,9 @@ require:
40
40
  Now you can run `rubocop` and it will automatically load the RuboCop Grape
41
41
  cops together with the standard cops.
42
42
 
43
+ > [!NOTE]
44
+ > The plugin system is supported in RuboCop 1.72+. In earlier versions, use `require` instead of `plugins`.
45
+
43
46
  ## Contributing
44
47
 
45
48
  Bug reports and pull requests are welcome on GitHub at https://github.com/kakubin/rubocop-grape.
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lint_roller'
4
+
5
+ module RuboCop
6
+ module Grape
7
+ # A plugin that integrates RuboCop Grape with RuboCop's plugin system.
8
+ class Plugin < LintRoller::Plugin
9
+ # :nocov:
10
+ def about
11
+ LintRoller::About.new(
12
+ name: 'rubocop-grape',
13
+ version: VERSION,
14
+ homepage: 'https://github.com/kakubin/rubocop-grape',
15
+ description: 'Code style checking for Grape files.'
16
+ )
17
+ end
18
+
19
+ # :nocov:
20
+ def supported?(context)
21
+ context.engine == :rubocop
22
+ end
23
+
24
+ def rules(_context)
25
+ project_root = Pathname.new(__dir__).join('../../..')
26
+ LintRoller::Rules.new(
27
+ type: :path,
28
+ config_format: :rubocop,
29
+ value: project_root.join('config/default.yml')
30
+ )
31
+ end
32
+ end
33
+ end
34
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Grape
5
- VERSION = '0.4.3'
5
+ VERSION = '0.5.0'
6
6
  end
7
7
  end
data/lib/rubocop/grape.rb CHANGED
@@ -5,10 +5,5 @@ require_relative 'grape/version'
5
5
  module RuboCop
6
6
  # RuboCop Grape project namespace
7
7
  module Grape
8
- PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
9
- CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').freeze
10
- CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
11
-
12
- private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
13
8
  end
14
9
  end
data/lib/rubocop-grape.rb CHANGED
@@ -4,9 +4,7 @@ require 'rubocop'
4
4
 
5
5
  require_relative 'rubocop/grape'
6
6
  require_relative 'rubocop/grape/version'
7
- require_relative 'rubocop/grape/inject'
8
-
9
- RuboCop::Grape::Inject.defaults!
7
+ require_relative 'rubocop/grape/plugin'
10
8
 
11
9
  require_relative 'rubocop/grape/grape_files'
12
10
 
metadata CHANGED
@@ -1,35 +1,48 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-grape
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akito Hikasa
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-04-09 00:00:00.000000000 Z
10
+ date: 2025-02-17 00:00:00.000000000 Z
12
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: lint_roller
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '1.1'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '1.1'
13
26
  - !ruby/object:Gem::Dependency
14
27
  name: rubocop
15
28
  requirement: !ruby/object:Gem::Requirement
16
29
  requirements:
17
30
  - - ">="
18
31
  - !ruby/object:Gem::Version
19
- version: 1.7.0
32
+ version: 1.72.1
20
33
  - - "<"
21
34
  - !ruby/object:Gem::Version
22
- version: '2.0'
35
+ version: '2'
23
36
  type: :runtime
24
37
  prerelease: false
25
38
  version_requirements: !ruby/object:Gem::Requirement
26
39
  requirements:
27
40
  - - ">="
28
41
  - !ruby/object:Gem::Version
29
- version: 1.7.0
42
+ version: 1.72.1
30
43
  - - "<"
31
44
  - !ruby/object:Gem::Version
32
- version: '2.0'
45
+ version: '2'
33
46
  description: |
34
47
  Automatic Grape code style checking tool.
35
48
  A RuboCop extension focused on enforcing Grape best practices and coding conventions.
@@ -55,7 +68,7 @@ files:
55
68
  - lib/rubocop/cop/mixin/endpoint_helper.rb
56
69
  - lib/rubocop/grape.rb
57
70
  - lib/rubocop/grape/grape_files.rb
58
- - lib/rubocop/grape/inject.rb
71
+ - lib/rubocop/grape/plugin.rb
59
72
  - lib/rubocop/grape/version.rb
60
73
  homepage: https://github.com/kakubin/rubocop-grape
61
74
  licenses:
@@ -65,7 +78,7 @@ metadata:
65
78
  homepage_uri: https://github.com/kakubin/rubocop-grape
66
79
  source_code_uri: https://github.com/kakubin/rubocop-grape
67
80
  changelog_uri: https://github.com/kakubin/rubocop-grape/blob/master/CHANGELOG.md
68
- post_install_message:
81
+ default_lint_roller_plugin: RuboCop::Grape::Plugin
69
82
  rdoc_options: []
70
83
  require_paths:
71
84
  - lib
@@ -73,15 +86,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
73
86
  requirements:
74
87
  - - ">="
75
88
  - !ruby/object:Gem::Version
76
- version: 2.6.0
89
+ version: 2.7.0
77
90
  required_rubygems_version: !ruby/object:Gem::Requirement
78
91
  requirements:
79
92
  - - ">="
80
93
  - !ruby/object:Gem::Version
81
94
  version: '0'
82
95
  requirements: []
83
- rubygems_version: 3.4.19
84
- signing_key:
96
+ rubygems_version: 3.6.2
85
97
  specification_version: 4
86
98
  summary: Automatice Grape code style checking tool.
87
99
  test_files: []
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module RuboCop
4
- module Grape
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.send(:load_yaml_configuration, path)
11
- config = Config.new(hash, path).tap(&:make_excludes_absolute)
12
- puts "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