rubocop_auto_corrector 0.4.3 → 0.4.4

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: 1a2679ad72983c8a3eba5331c78de88b409d89b24b4ffff28d1749ebf8a95710
4
- data.tar.gz: d1c2eb2109af696b61254b55525226988cb18975c95838a513cba19e1f0542db
3
+ metadata.gz: e91fedba37711c0aefe1699507efe76c79e3951cf51225f90f9ba4b6c67bae46
4
+ data.tar.gz: fc9a30691023ff02f207e4f2ba159c8be0d63af1fe7ef0da7cf7a8854eee8608
5
5
  SHA512:
6
- metadata.gz: 5618a1266b9bda62b0f310451c70a9fcfdfc2de3b0e411b36270d3a3725abe46083aa27ef57f54a07676705bd6b2ff3e4e72d8a509daf12efa36a89464cd1842
7
- data.tar.gz: 3e754cb44ebbb4aea4468a011ec76039fa5ab6e8ad6b23aaf5526b79a6b59915e29f23d3743cbfe49345b4cd15289ebd466564713dd5814c35acdb3112b41662
6
+ metadata.gz: da0aba556ff5725420c63ccfc01f3a4deee3aed45a3f8d861c7823a85a06d719da999965d8323beff578fbb5268fe727865d15aa7b6fa71469c2cf2bad7f43cb
7
+ data.tar.gz: fc17bd65c9937e3c503d37c3a7c53c864940e0fe6955a1c7aa282ea864f5c55ec5bb8bea5f88b113e5846248f59ba0e3d86a823b6b7296ab336aa86cc756652e
@@ -12,9 +12,6 @@ on:
12
12
  schedule:
13
13
  - cron: "0 10 * * 5" # JST 19:00 (Fri)
14
14
 
15
- env:
16
- CI: "true"
17
-
18
15
  jobs:
19
16
  test:
20
17
  runs-on: ubuntu-latest
@@ -26,10 +23,10 @@ jobs:
26
23
 
27
24
  matrix:
28
25
  ruby:
29
- - ruby:2.5
30
26
  - ruby:2.6
31
27
  - ruby:2.7
32
28
  - ruby:3.0
29
+ - ruby:3.1
33
30
  - rubylang/ruby:master-nightly-bionic
34
31
  include:
35
32
  - ruby: rubylang/ruby:master-nightly-bionic
@@ -38,7 +35,6 @@ jobs:
38
35
  steps:
39
36
  - uses: actions/checkout@v2
40
37
 
41
-
42
38
  - name: Cache vendor/bundle
43
39
  uses: actions/cache@v1
44
40
  id: cache_gem
data/.rubocop.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  AllCops:
2
- # rubocop 1.13.0+ requires ruby 2.5+
3
- TargetRubyVersion: 2.5
2
+ # rubocop 1.3.0+ requires ruby 2.6+
3
+ TargetRubyVersion: 2.6
4
4
 
5
5
  Exclude:
6
6
  - 'spec/dummy/**/*'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## master
2
- [full changelog](http://github.com/sue445/rubocop_auto_corrector/compare/v0.4.3...master)
2
+ [full changelog](http://github.com/sue445/rubocop_auto_corrector/compare/v0.4.4...master)
3
+
4
+ ## v0.4.4
5
+ [full changelog](http://github.com/sue445/rubocop_auto_corrector/compare/v0.4.3...v0.4.4)
6
+
7
+ * Migrate to `--autocorrect` and requires rubocop 1.3.0+
8
+ * https://github.com/sue445/rubocop_auto_corrector/pull/48
9
+ * `--auto-correct-count` is deprecated, use `--autocorrect-count`
3
10
 
4
11
  ## v0.4.3
5
12
  [full changelog](http://github.com/sue445/rubocop_auto_corrector/compare/v0.4.2...v0.4.3)
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # RubocopAutoCorrector
2
2
 
3
- Run `rubocop --auto-correct && git commit` with each cop.
3
+ Run `rubocop --autocorrect && git commit` with each cop.
4
4
 
5
5
  [![Gem Version](https://badge.fury.io/rb/rubocop_auto_corrector.svg)](https://badge.fury.io/rb/rubocop_auto_corrector)
6
6
  [![Build Status](https://github.com/sue445/rubocop_auto_corrector/workflows/test/badge.svg?branch=master)](https://github.com/sue445/rubocop_auto_corrector/actions?query=workflow%3Atest)
@@ -41,8 +41,9 @@ $ bundle exec rubocop_auto_corrector
41
41
  ```bash
42
42
  $ bundle exec rubocop_auto_corrector --help
43
43
  Usage: rubocop_auto_corrector [options]
44
- --auto-correct-count COUNT Run `rubocop --auto-correct` and `git commit` for this number of times. (default. 2)
45
- --all Whether run `rubocop` with `--auto-correct-all`. (default. run with `--auto-correct`)
44
+ --autocorrect-count COUNT Run `rubocop --autocorrect` and `git commit` for this number of times. (default. 2)
45
+ --auto-correct-count COUNT Same to '--autocorrect-count' (deprecated)
46
+ --all Whether run `rubocop` with `--autocorrect-all`. (default. run with `--autocorrect`)
46
47
  ```
47
48
 
48
49
  ## Development
@@ -13,14 +13,22 @@ params = {
13
13
 
14
14
  Version = RubocopAutoCorrector::VERSION
15
15
 
16
+ opt.on(
17
+ '--autocorrect-count COUNT',
18
+ 'Run `rubocop --autocorrect` and `git commit` for this number of times. (default. 2)'
19
+ ) do |v|
20
+ params[:auto_correct_count] = v.to_i
21
+ end
22
+
16
23
  opt.on(
17
24
  '--auto-correct-count COUNT',
18
- 'Run `rubocop --auto-correct` and `git commit` for this number of times. (default. 2)'
25
+ "Same to '--autocorrect-count' (deprecated)"
19
26
  ) do |v|
27
+ puts "[DEPRECATED] '--auto-correct-count' is deprecated, use '--autocorrect-count'"
20
28
  params[:auto_correct_count] = v.to_i
21
29
  end
22
30
 
23
- opt.on('--all', 'Whether run `rubocop` with `--auto-correct-all`. (default. run with `--auto-correct`)') do
31
+ opt.on('--all', 'Whether run `rubocop` with `--autocorrect-all`. (default. run with `--autocorrect`)') do
24
32
  params[:auto_correct_all] = true
25
33
  end
26
34
 
@@ -16,7 +16,7 @@ module RubocopAutoCorrector
16
16
  end
17
17
 
18
18
  def perform(auto_collect_all)
19
- rubocop_option = auto_collect_all ? '--auto-correct-all' : '--auto-correct'
19
+ rubocop_option = auto_collect_all ? '--autocorrect-all' : '--autocorrect'
20
20
 
21
21
  cop_names = collect_offense_cop_names.select { |cop_name| auto_correctable?(cop_name) }
22
22
  .sort_by { |cop_name| [cop_order(cop_name), cop_name] }
@@ -49,22 +49,25 @@ module RubocopAutoCorrector
49
49
 
50
50
  # rubocop:disable Metrics/MethodLength
51
51
  def rubocop_cop_info
52
+ return @rubocop_cop_info if @rubocop_cop_info
53
+
52
54
  cop_class_suffix = cop_name.gsub('/', '::')
53
55
 
54
- case cop_name
55
- when %r{^RSpec/}
56
- ['rubocop-rspec', "::RuboCop::Cop::#{cop_class_suffix}"]
57
- when %r{^(FactoryBot|Capybara)/}, 'Rails/HttpStatus'
58
- ['rubocop-rspec', "::RuboCop::Cop::RSpec::#{cop_class_suffix}"]
59
- when %r{^(Layout|Lint|Metrics|Naming|Security|Style|Bundler|Gemspec)/}
60
- # Official cops
61
- ['rubocop', "::RuboCop::Cop::#{cop_class_suffix}"]
62
- else
63
- # Unknown cops
64
- department_camel = cop_name.split('/').first
65
- department_snake = department_camel.gsub(/(?<=.)([A-Z])/) { |s| "_#{s}" }.downcase
66
- ["rubocop-#{department_snake}", "::RuboCop::Cop::#{cop_class_suffix}"]
67
- end
56
+ @rubocop_cop_info =
57
+ case cop_name
58
+ when %r{^RSpec/}
59
+ ['rubocop-rspec', "::RuboCop::Cop::#{cop_class_suffix}"]
60
+ when %r{^(FactoryBot|Capybara)/}, 'Rails/HttpStatus'
61
+ ['rubocop-rspec', "::RuboCop::Cop::RSpec::#{cop_class_suffix}"]
62
+ when %r{^(Layout|Lint|Metrics|Naming|Security|Style|Bundler|Gemspec)/}
63
+ # Official cops
64
+ ['rubocop', "::RuboCop::Cop::#{cop_class_suffix}"]
65
+ else
66
+ # Unknown cops
67
+ department_camel = cop_name.split('/').first
68
+ department_snake = department_camel.gsub(/(?<=.)([A-Z])/) { |s| "_#{s}" }.downcase
69
+ ["rubocop-#{department_snake}", "::RuboCop::Cop::#{cop_class_suffix}"]
70
+ end
68
71
  end
69
72
  # rubocop:enable Metrics/MethodLength
70
73
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubocopAutoCorrector
4
- VERSION = '0.4.3'
4
+ VERSION = '0.4.4'
5
5
  end
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
10
10
  spec.authors = ['sue445']
11
11
  spec.email = ['sue445@sue445.net']
12
12
 
13
- spec.summary = 'Run `rubocop --auto-correct && git commit` with each cop.'
14
- spec.description = 'Run `rubocop --auto-correct && git commit` with each cop.'
13
+ spec.summary = 'Run `rubocop --autocorrect && git commit` with each cop.'
14
+ spec.description = 'Run `rubocop --autocorrect && git commit` with each cop.'
15
15
  spec.homepage = 'https://github.com/sue445/rubocop_auto_corrector'
16
16
  spec.license = 'MIT'
17
17
 
@@ -36,9 +36,9 @@ Gem::Specification.new do |spec|
36
36
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
37
  spec.require_paths = ['lib']
38
38
 
39
- spec.required_ruby_version = '>= 2.5.0'
39
+ spec.required_ruby_version = '>= 2.6.0'
40
40
 
41
- spec.add_dependency 'rubocop', '>= 1.13.0'
41
+ spec.add_dependency 'rubocop', '>= 1.3.0'
42
42
 
43
43
  spec.add_development_dependency 'bundler', '>= 1.17'
44
44
  spec.add_development_dependency 'coveralls'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop_auto_corrector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-18 00:00:00.000000000 Z
11
+ date: 2022-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.13.0
19
+ version: 1.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.13.0
26
+ version: 1.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -164,7 +164,7 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: 0.4.5
167
- description: Run `rubocop --auto-correct && git commit` with each cop.
167
+ description: Run `rubocop --autocorrect && git commit` with each cop.
168
168
  email:
169
169
  - sue445@sue445.net
170
170
  executables:
@@ -207,15 +207,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
207
207
  requirements:
208
208
  - - ">="
209
209
  - !ruby/object:Gem::Version
210
- version: 2.5.0
210
+ version: 2.6.0
211
211
  required_rubygems_version: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - ">="
214
214
  - !ruby/object:Gem::Version
215
215
  version: '0'
216
216
  requirements: []
217
- rubygems_version: 3.2.22
217
+ rubygems_version: 3.3.7
218
218
  signing_key:
219
219
  specification_version: 4
220
- summary: Run `rubocop --auto-correct && git commit` with each cop.
220
+ summary: Run `rubocop --autocorrect && git commit` with each cop.
221
221
  test_files: []