rubocop-rake 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +34 -0
- data/.rubocop.yml +17 -9
- data/CHANGELOG.md +5 -0
- data/Gemfile +2 -2
- data/README.md +38 -3
- data/lib/rubocop/cop/rake/class_definition_in_task.rb +1 -1
- data/lib/rubocop/cop/rake/desc.rb +1 -1
- data/lib/rubocop/cop/rake/duplicate_namespace.rb +1 -1
- data/lib/rubocop/cop/rake/duplicate_task.rb +1 -1
- data/lib/rubocop/cop/rake/helper/on_task.rb +2 -0
- data/lib/rubocop/cop/rake/helper/task_name.rb +1 -1
- data/lib/rubocop/cop/rake/method_definition_in_task.rb +1 -1
- data/lib/rubocop/rake/plugin.rb +31 -0
- data/lib/rubocop/rake/version.rb +1 -1
- data/lib/rubocop/rake.rb +0 -6
- data/lib/rubocop-rake.rb +1 -3
- data/rubocop-rake.gemspec +11 -7
- metadata +25 -12
- data/.circleci/config.yml +0 -44
- data/lib/rubocop/rake/inject.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c253f7db93c311dcb08404abf4f310b37447bb191349022774f4b1d3b0801a47
|
4
|
+
data.tar.gz: 7cf21f3beb4f90cca3006c320c684c5dbe44d3279c4b65ea2ad24287a0e473b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4370c9fb5c2f1aa26eff13f35d659decdacdcc33f4f5b71dc685ff6361987307a808f230de0359b1651934bdb1823d40134b707145b5ef4502784f43c82f3fe
|
7
|
+
data.tar.gz: 362266888433803919694e02787905a4d775f0ce5c76d79984572bbb673e24b4e7105f4fe8db6425e9622d828f8d4dba137293f434594f4e9210786532d428ee
|
@@ -0,0 +1,34 @@
|
|
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
|
+
name: "Ruby ${{ matrix.ruby }}: spec"
|
28
|
+
steps:
|
29
|
+
- uses: actions/checkout@v4
|
30
|
+
- uses: ruby/setup-ruby@v1
|
31
|
+
with:
|
32
|
+
ruby-version: "${{ matrix.ruby }}"
|
33
|
+
bundler-cache: true
|
34
|
+
- run: bundle exec rake
|
data/.rubocop.yml
CHANGED
@@ -1,16 +1,22 @@
|
|
1
1
|
inherit_from: .rubocop_todo.yml
|
2
2
|
|
3
|
-
|
4
|
-
- rubocop
|
3
|
+
plugins:
|
4
|
+
- rubocop-internal_affairs
|
5
5
|
- rubocop-rake
|
6
|
+
|
7
|
+
require:
|
6
8
|
- rubocop-rspec
|
7
9
|
|
8
10
|
AllCops:
|
9
|
-
|
11
|
+
NewCops: enable
|
12
|
+
TargetRubyVersion: 2.7
|
10
13
|
|
11
14
|
InternalAffairs/NodeMatcherDirective:
|
12
15
|
Enabled: false
|
13
16
|
|
17
|
+
InternalAffairs/OnSendWithoutOnCSend:
|
18
|
+
Enabled: false
|
19
|
+
|
14
20
|
Layout/LineLength:
|
15
21
|
Enabled: false
|
16
22
|
|
@@ -43,14 +49,16 @@ Style/PercentLiteralDelimiters:
|
|
43
49
|
Style/TrailingCommaInArguments:
|
44
50
|
EnforcedStyleForMultiline: comma
|
45
51
|
|
46
|
-
RSpec/ExampleLength:
|
47
|
-
Enabled: false
|
48
|
-
|
49
52
|
Naming/FileName:
|
50
53
|
Exclude:
|
51
54
|
- 'lib/rubocop-rake.rb'
|
52
55
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
+
RSpec:
|
57
|
+
Language:
|
58
|
+
Expectations:
|
59
|
+
- expect_correction
|
60
|
+
- expect_no_offenses
|
61
|
+
- expect_offense
|
62
|
+
|
63
|
+
RSpec/ExampleLength:
|
56
64
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 0.7.0 (2025-02-16)
|
6
|
+
|
7
|
+
* [#58](https://github.com/rubocop/rubocop-rake/pull/58): Pluginfy RuboCop Rake. ([@koic][])
|
8
|
+
* [#57](https://github.com/rubocop/rubocop-rake/pull/57): Drop support Ruby 2.5 and 2.6 for runtime environment. ([@koic][])
|
9
|
+
|
5
10
|
## 0.6.0 (2021-06-29)
|
6
11
|
|
7
12
|
### Changes
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
[](https://rubygems.org/gems/rubocop-rake)
|
2
|
-
|
2
|
+

|
3
3
|
|
4
4
|
# RuboCop Rake
|
5
5
|
|
@@ -23,12 +23,48 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
## Usage
|
25
25
|
|
26
|
+
You need to tell RuboCop to load the Rake extension. There are three
|
27
|
+
ways to do this:
|
28
|
+
|
29
|
+
### RuboCop configuration file
|
30
|
+
|
26
31
|
Put this into your `.rubocop.yml`.
|
27
32
|
|
28
33
|
```yaml
|
29
|
-
|
34
|
+
plugins: rubocop-rake
|
35
|
+
```
|
36
|
+
|
37
|
+
Alternatively, use the following array notation when specifying multiple extensions.
|
38
|
+
|
39
|
+
```yaml
|
40
|
+
plugins:
|
41
|
+
- rubocop-other-extension
|
42
|
+
- rubocop-rake
|
43
|
+
```
|
44
|
+
|
45
|
+
Now you can run `rubocop` and it will automatically load the RuboCop Rake
|
46
|
+
cops together with the standard cops.
|
47
|
+
|
48
|
+
> [!NOTE]
|
49
|
+
> The plugin system is supported in RuboCop 1.72+. In earlier versions, use `require` instead of `plugins`.
|
50
|
+
|
51
|
+
### Command line
|
52
|
+
|
53
|
+
```bash
|
54
|
+
rubocop --plugin rubocop-rake
|
30
55
|
```
|
31
56
|
|
57
|
+
### Rake task
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
require 'rubocop/rake_task'
|
61
|
+
|
62
|
+
RuboCop::RakeTask.new do |task|
|
63
|
+
task.plugins << 'rubocop-rake'
|
64
|
+
end
|
65
|
+
```
|
66
|
+
|
67
|
+
|
32
68
|
## Development
|
33
69
|
|
34
70
|
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.
|
@@ -38,4 +74,3 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
38
74
|
## Contributing
|
39
75
|
|
40
76
|
Bug reports and pull requests are welcome on GitHub at https://github.com/rubocop/rubocop-rake.
|
41
|
-
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module RuboCop
|
4
4
|
module Cop
|
5
5
|
module Rake
|
6
|
-
#
|
6
|
+
# Detects class or module definition in a task or namespace,
|
7
7
|
# because it is defined to the top level.
|
8
8
|
# It is confusing because the scope looks in the task or namespace,
|
9
9
|
# but actually it is defined to the top level.
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module RuboCop
|
4
4
|
module Cop
|
5
5
|
module Rake
|
6
|
-
#
|
6
|
+
# Detects method definition in a task or namespace,
|
7
7
|
# because it is defined to the top level.
|
8
8
|
# It is confusing because the scope looks in the task or namespace,
|
9
9
|
# but actually it is defined to the top level.
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'lint_roller'
|
4
|
+
|
5
|
+
module RuboCop
|
6
|
+
module Rake
|
7
|
+
# A plugin that integrates RuboCop Rake with RuboCop's plugin system.
|
8
|
+
class Plugin < LintRoller::Plugin
|
9
|
+
def about
|
10
|
+
LintRoller::About.new(
|
11
|
+
name: 'rubocop-rake',
|
12
|
+
version: Version::STRING,
|
13
|
+
homepage: 'https://github.com/rubocop/rubocop-rake',
|
14
|
+
description: 'A RuboCop plugin for Rake.',
|
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
|
data/lib/rubocop/rake/version.rb
CHANGED
data/lib/rubocop/rake.rb
CHANGED
@@ -6,11 +6,5 @@ module RuboCop
|
|
6
6
|
# :nodoc:
|
7
7
|
module Rake
|
8
8
|
class Error < StandardError; end
|
9
|
-
|
10
|
-
PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
|
11
|
-
CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').freeze
|
12
|
-
CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
|
13
|
-
|
14
|
-
private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
|
15
9
|
end
|
16
10
|
end
|
data/lib/rubocop-rake.rb
CHANGED
@@ -4,9 +4,7 @@ require 'rubocop'
|
|
4
4
|
|
5
5
|
require_relative 'rubocop/rake'
|
6
6
|
require_relative 'rubocop/rake/version'
|
7
|
-
require_relative 'rubocop/rake/
|
8
|
-
|
9
|
-
RuboCop::Rake::Inject.defaults!
|
7
|
+
require_relative 'rubocop/rake/plugin'
|
10
8
|
|
11
9
|
require_relative 'rubocop/cop/rake/helper/class_definition'
|
12
10
|
require_relative 'rubocop/cop/rake/helper/on_task'
|
data/rubocop-rake.gemspec
CHANGED
@@ -11,14 +11,17 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = %q{A RuboCop plugin for Rake}
|
12
12
|
spec.description = %q{A RuboCop plugin for Rake}
|
13
13
|
spec.homepage = "https://github.com/rubocop/rubocop-rake"
|
14
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
14
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
15
15
|
spec.licenses = ['MIT']
|
16
16
|
|
17
|
-
spec.metadata
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
spec.metadata = {
|
18
|
+
'allowed_push_host' => 'https://rubygems.org',
|
19
|
+
'homepage_uri' => spec.homepage,
|
20
|
+
'source_code_uri' => spec.homepage,
|
21
|
+
'changelog_uri' => "https://github.com/rubocop/rubocop-rake/blob/master/CHANGELOG.md",
|
22
|
+
'rubygems_mfa_required' => 'true',
|
23
|
+
'default_lint_roller_plugin' => 'RuboCop::Rake::Plugin'
|
24
|
+
}
|
22
25
|
|
23
26
|
# Specify which files should be added to the gem when it is released.
|
24
27
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -29,5 +32,6 @@ Gem::Specification.new do |spec|
|
|
29
32
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
30
33
|
spec.require_paths = ["lib"]
|
31
34
|
|
32
|
-
spec.
|
35
|
+
spec.add_dependency 'lint_roller', '~> 1.1'
|
36
|
+
spec.add_dependency 'rubocop', '>= 1.72.1'
|
33
37
|
end
|
metadata
CHANGED
@@ -1,29 +1,42 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-rake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masataka Pocke Kuwabara
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-15 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
13
|
+
name: lint_roller
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
16
|
- - "~>"
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
18
|
+
version: '1.1'
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
23
|
- - "~>"
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
25
|
+
version: '1.1'
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: rubocop
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.72.1
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 1.72.1
|
27
40
|
description: A RuboCop plugin for Rake
|
28
41
|
email:
|
29
42
|
- kuwabara@pocke.me
|
@@ -31,7 +44,7 @@ executables: []
|
|
31
44
|
extensions: []
|
32
45
|
extra_rdoc_files: []
|
33
46
|
files:
|
34
|
-
- ".
|
47
|
+
- ".github/workflows/main.yml"
|
35
48
|
- ".gitignore"
|
36
49
|
- ".rspec"
|
37
50
|
- ".rubocop.yml"
|
@@ -57,7 +70,7 @@ files:
|
|
57
70
|
- lib/rubocop/cop/rake/method_definition_in_task.rb
|
58
71
|
- lib/rubocop/cop/rake_cops.rb
|
59
72
|
- lib/rubocop/rake.rb
|
60
|
-
- lib/rubocop/rake/
|
73
|
+
- lib/rubocop/rake/plugin.rb
|
61
74
|
- lib/rubocop/rake/version.rb
|
62
75
|
- rubocop-rake.gemspec
|
63
76
|
homepage: https://github.com/rubocop/rubocop-rake
|
@@ -68,7 +81,8 @@ metadata:
|
|
68
81
|
homepage_uri: https://github.com/rubocop/rubocop-rake
|
69
82
|
source_code_uri: https://github.com/rubocop/rubocop-rake
|
70
83
|
changelog_uri: https://github.com/rubocop/rubocop-rake/blob/master/CHANGELOG.md
|
71
|
-
|
84
|
+
rubygems_mfa_required: 'true'
|
85
|
+
default_lint_roller_plugin: RuboCop::Rake::Plugin
|
72
86
|
rdoc_options: []
|
73
87
|
require_paths:
|
74
88
|
- lib
|
@@ -76,15 +90,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
76
90
|
requirements:
|
77
91
|
- - ">="
|
78
92
|
- !ruby/object:Gem::Version
|
79
|
-
version: 2.
|
93
|
+
version: 2.7.0
|
80
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
95
|
requirements:
|
82
96
|
- - ">="
|
83
97
|
- !ruby/object:Gem::Version
|
84
98
|
version: '0'
|
85
99
|
requirements: []
|
86
|
-
rubygems_version: 3.
|
87
|
-
signing_key:
|
100
|
+
rubygems_version: 3.7.0.dev
|
88
101
|
specification_version: 4
|
89
102
|
summary: A RuboCop plugin for Rake
|
90
103
|
test_files: []
|
data/.circleci/config.yml
DELETED
@@ -1,44 +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
|
-
|
11
|
-
ruby-2.5:
|
12
|
-
docker:
|
13
|
-
- image: circleci/ruby:2.5
|
14
|
-
<<: *steps
|
15
|
-
|
16
|
-
ruby-2.6:
|
17
|
-
docker:
|
18
|
-
- image: circleci/ruby:2.6
|
19
|
-
<<: *steps
|
20
|
-
|
21
|
-
ruby-2.7:
|
22
|
-
docker:
|
23
|
-
- image: circleci/ruby:2.7
|
24
|
-
<<: *steps
|
25
|
-
|
26
|
-
ruby-3.0:
|
27
|
-
docker:
|
28
|
-
- image: circleci/ruby:3.0
|
29
|
-
<<: *steps
|
30
|
-
|
31
|
-
ruby-head:
|
32
|
-
docker:
|
33
|
-
- image: rubocophq/circleci-ruby-snapshot:latest
|
34
|
-
<<: *steps
|
35
|
-
|
36
|
-
workflows:
|
37
|
-
version: 2
|
38
|
-
build:
|
39
|
-
jobs:
|
40
|
-
- ruby-2.5
|
41
|
-
- ruby-2.6
|
42
|
-
- ruby-2.7
|
43
|
-
- ruby-3.0
|
44
|
-
- ruby-head
|
data/lib/rubocop/rake/inject.rb
DELETED
@@ -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 Rake
|
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
|