rubocop-rubycw 0.1.6 → 0.2.1

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: 979e01a9b40b87393441a06a1c664f1ae89a09872fb4dcf067154201a1805559
4
- data.tar.gz: 6cc2b141cd593ef75a81790cc5038f1b79e5d3305461a5d6b7d1505025e36226
3
+ metadata.gz: 46ad8b5050db8fda6b392805dd336e0eb4e6c0222497249db38fbd18db15d2f7
4
+ data.tar.gz: a41f74f859db37ae15bfe66271b0a05a56ca72f587c67b420786bc559d7f2f41
5
5
  SHA512:
6
- metadata.gz: f8f915423ace490c3a5537cc5fef4a4df02ca2c990387248a08dfeab217f478bad71e141c7d1aa69f058c93e50d6cf5b1a1d78d26f89ce0a35f1a2b046f13bbf
7
- data.tar.gz: 40f956aaa1ef3f9cfbbf89f2d7ae182e9f3ac9a50b0c655b0f2f7c298c1f627aca3318e882a71fb4459c23b15cb4aa8ee3e24410ad7625bfc3f106566905c3f0
6
+ metadata.gz: d3ff2e2b1c19b07fb6118c4408bab77f87a051827a9496bed37b9880cf551c80f8afc9d7138e15f8b6417b265b010e430e89a43b796acb7d3df6c70e63499bca
7
+ data.tar.gz: b68f306a62e8aa723265de8995b4bb4197703c42820cf143e8f74582c7fb252d710988d1bf6bbe7b822b0cd6f2d231d41b9eb39efe3465c64927f93e0607baf2
@@ -0,0 +1,36 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - master
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ main:
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby:
20
+ - "2.7"
21
+ - "3.0"
22
+ - "3.1"
23
+ - "3.2"
24
+ - "3.3"
25
+ - "3.4"
26
+ - ruby-head
27
+ task:
28
+ - spec
29
+ name: Ruby ${{ matrix.ruby }}
30
+ steps:
31
+ - uses: actions/checkout@v4
32
+ - uses: ruby/setup-ruby@v1
33
+ with:
34
+ ruby-version: ${{ matrix.ruby }}
35
+ bundler-cache: true
36
+ - run: bundle exec rake
data/Gemfile CHANGED
@@ -3,5 +3,5 @@ source "https://rubygems.org"
3
3
  # Specify your gem's dependencies in rubocop-rubycw.gemspec
4
4
  gemspec
5
5
 
6
- gem "rake", "~> 12.0"
6
+ gem "rake", "~> 13.0"
7
7
  gem 'rspec'
data/README.md CHANGED
@@ -6,9 +6,7 @@ You can get Ruby's warning as a RuboCop offense by rubocop-rubycw.
6
6
 
7
7
  ## Requirements
8
8
 
9
- * Ruby 2.4 or greater.
10
- * But I highly recommend to use Ruby 2.6 or greater.
11
- Because it is about 10x slower if it works on Ruby 2.5 or lower.
9
+ * Ruby 2.7 or greater.
12
10
 
13
11
  ## Installation
14
12
 
@@ -31,9 +29,12 @@ Or install it yourself as:
31
29
  Put this into your `.rubocop.yml`.
32
30
 
33
31
  ```yaml
34
- require: rubocop-rubycw
32
+ plugins: rubocop-rubycw
35
33
  ```
36
34
 
35
+ > [!NOTE]
36
+ > The plugin system is supported in RuboCop 1.72+. In earlier versions, use `require` instead of `plugins`.
37
+
37
38
  ## Development
38
39
 
39
40
  After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'lint_roller'
4
+
5
+ module RuboCop
6
+ module Rubycw
7
+ # A plugin that integrates RuboCop Rubycw with RuboCop's plugin system.
8
+ class Plugin < LintRoller::Plugin
9
+ def about
10
+ LintRoller::About.new(
11
+ name: 'rubocop-rubycw',
12
+ version: VERSION,
13
+ homepage: 'https://github.com/rubocop/rubocop-rubycw',
14
+ description: 'Integrate RuboCop and `ruby -cw`.'
15
+ )
16
+ end
17
+
18
+ def supported?(context)
19
+ context.engine == :rubocop
20
+ end
21
+
22
+ def rules(_context)
23
+ LintRoller::Rules.new(
24
+ type: :path,
25
+ config_format: :rubocop,
26
+ value: Pathname.new(__dir__).join('../../../config/default.yml')
27
+ )
28
+ end
29
+ end
30
+ end
31
+ end
@@ -1,5 +1,5 @@
1
1
  module RuboCop
2
2
  module Rubycw
3
- VERSION = "0.1.6"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
@@ -4,9 +4,6 @@ require 'rubocop'
4
4
 
5
5
  require_relative 'rubocop/rubycw'
6
6
  require_relative 'rubocop/rubycw/version'
7
- require_relative 'rubocop/rubycw/inject'
8
-
9
- RuboCop::Rubycw::Inject.defaults!
10
-
7
+ require_relative 'rubocop/rubycw/plugin'
11
8
  require_relative 'rubocop/rubycw/warning_capturer'
12
9
  require_relative 'rubocop/cop/rubycw_cops'
@@ -9,14 +9,14 @@ Gem::Specification.new do |spec|
9
9
  spec.summary = %q{Integrate RuboCop and ruby -cw}
10
10
  spec.description = %q{Integrate RuboCop and ruby -cw}
11
11
  spec.homepage = "https://github.com/rubocop/rubocop-rubycw"
12
- spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
12
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
13
13
  spec.license = 'MIT'
14
14
 
15
15
  # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
16
16
 
17
17
  spec.metadata["homepage_uri"] = spec.homepage
18
18
  spec.metadata["source_code_uri"] = spec.homepage
19
- # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
19
+ spec.metadata["default_lint_roller_plugin"] = 'RuboCop::Rubycw::Plugin'
20
20
 
21
21
  # Specify which files should be added to the gem when it is released.
22
22
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -27,5 +27,6 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
29
 
30
- spec.add_runtime_dependency 'rubocop', '~> 1.0'
30
+ spec.add_runtime_dependency 'lint_roller', '~> 1.1'
31
+ spec.add_runtime_dependency 'rubocop', '~> 1.72.1'
31
32
  end
metadata CHANGED
@@ -1,29 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-rubycw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masataka Pocke Kuwabara
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-23 00:00:00.000000000 Z
11
+ date: 2025-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: lint_roller
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.1'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rubocop
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - "~>"
18
32
  - !ruby/object:Gem::Version
19
- version: '1.0'
33
+ version: 1.72.1
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - "~>"
25
39
  - !ruby/object:Gem::Version
26
- version: '1.0'
40
+ version: 1.72.1
27
41
  description: Integrate RuboCop and ruby -cw
28
42
  email:
29
43
  - kuwabara@pocke.me
@@ -31,7 +45,7 @@ executables: []
31
45
  extensions: []
32
46
  extra_rdoc_files: []
33
47
  files:
34
- - ".circleci/config.yml"
48
+ - ".github/workflows/main.yml"
35
49
  - ".gitignore"
36
50
  - ".rspec"
37
51
  - ".rubocop.yml"
@@ -46,7 +60,7 @@ files:
46
60
  - lib/rubocop/cop/rubycw/rubycw.rb
47
61
  - lib/rubocop/cop/rubycw_cops.rb
48
62
  - lib/rubocop/rubycw.rb
49
- - lib/rubocop/rubycw/inject.rb
63
+ - lib/rubocop/rubycw/plugin.rb
50
64
  - lib/rubocop/rubycw/version.rb
51
65
  - lib/rubocop/rubycw/warning_capturer.rb
52
66
  - rubocop-rubycw.gemspec
@@ -56,6 +70,7 @@ licenses:
56
70
  metadata:
57
71
  homepage_uri: https://github.com/rubocop/rubocop-rubycw
58
72
  source_code_uri: https://github.com/rubocop/rubocop-rubycw
73
+ default_lint_roller_plugin: RuboCop::Rubycw::Plugin
59
74
  post_install_message:
60
75
  rdoc_options: []
61
76
  require_paths:
@@ -64,14 +79,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
64
79
  requirements:
65
80
  - - ">="
66
81
  - !ruby/object:Gem::Version
67
- version: 2.4.0
82
+ version: 2.7.0
68
83
  required_rubygems_version: !ruby/object:Gem::Requirement
69
84
  requirements:
70
85
  - - ">="
71
86
  - !ruby/object:Gem::Version
72
87
  version: '0'
73
88
  requirements: []
74
- rubygems_version: 3.3.0.dev
89
+ rubygems_version: 3.1.6
75
90
  signing_key:
76
91
  specification_version: 4
77
92
  summary: Integrate RuboCop and ruby -cw
data/.circleci/config.yml DELETED
@@ -1,49 +0,0 @@
1
- version: 2
2
-
3
- steps: &steps
4
- steps:
5
- - checkout
6
- - run: bundle install
7
- - run: bundle exec rake
8
-
9
- jobs:
10
- ruby-2.4:
11
- docker:
12
- - image: circleci/ruby:2.4
13
- <<: *steps
14
-
15
- ruby-2.5:
16
- docker:
17
- - image: circleci/ruby:2.5
18
- <<: *steps
19
-
20
- ruby-2.6:
21
- docker:
22
- - image: circleci/ruby:2.6
23
- <<: *steps
24
-
25
- ruby-2.7:
26
- docker:
27
- - image: circleci/ruby:2.7
28
- <<: *steps
29
-
30
- ruby-3.0:
31
- docker:
32
- - image: circleci/ruby:3.0
33
- <<: *steps
34
-
35
- ruby-head:
36
- docker:
37
- - image: rubocophq/circleci-ruby-snapshot:latest
38
- <<: *steps
39
-
40
- workflows:
41
- version: 2
42
- build:
43
- jobs:
44
- - ruby-2.4
45
- - ruby-2.5
46
- - ruby-2.6
47
- - ruby-2.7
48
- - ruby-3.0
49
- - ruby-head
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # The original code is from https://github.com/rubocop/rubocop-rspec/blob/master/lib/rubocop/rspec/inject.rb
4
- # See https://github.com/rubocop/rubocop-rspec/blob/master/MIT-LICENSE.md
5
- module RuboCop
6
- module Rubycw
7
- # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
8
- # bit of our configuration.
9
- module Inject
10
- def self.defaults!
11
- path = CONFIG_DEFAULT.to_s
12
- hash = ConfigLoader.send(:load_yaml_configuration, path)
13
- config = Config.new(hash, path)
14
- puts "configuration from #{path}" if ConfigLoader.debug?
15
- config = ConfigLoader.merge_with_default(config, path)
16
- ConfigLoader.instance_variable_set(:@default_configuration, config)
17
- end
18
- end
19
- end
20
- end