rubocop_auto_corrector 0.4.3 → 0.4.5

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: 1a2679ad72983c8a3eba5331c78de88b409d89b24b4ffff28d1749ebf8a95710
4
- data.tar.gz: d1c2eb2109af696b61254b55525226988cb18975c95838a513cba19e1f0542db
3
+ metadata.gz: 441e167174a1279880bfd7116306ee17af4a724d71081afba45e10e6eca41312
4
+ data.tar.gz: e7866a2e713aa220c12ae604cb696d929f8b21e92495fcb5922a83861b318436
5
5
  SHA512:
6
- metadata.gz: 5618a1266b9bda62b0f310451c70a9fcfdfc2de3b0e411b36270d3a3725abe46083aa27ef57f54a07676705bd6b2ff3e4e72d8a509daf12efa36a89464cd1842
7
- data.tar.gz: 3e754cb44ebbb4aea4468a011ec76039fa5ab6e8ad6b23aaf5526b79a6b59915e29f23d3743cbfe49345b4cd15289ebd466564713dd5814c35acdb3112b41662
6
+ metadata.gz: 9416144dcdfb9d124bd7e0e7debb1c6e83c51ce1e4964664abbad4252cae3bc9ccf44a6745f81a57058704d93b755bd659e3a3eba3c20c7768ce36095794a1c9
7
+ data.tar.gz: d1daa1c4eb297c2f78d87be36c990a653f7e9fd3264a03a8769636741c0fa271af4592f47088dd35e18991663ff2f427265f31a780b497d1045e9ca41dd8fd27
@@ -0,0 +1,10 @@
1
+ # c.f. https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
2
+ version: 2
3
+
4
+ updates:
5
+ - package-ecosystem: github-actions
6
+ directory: /
7
+ schedule:
8
+ interval: weekly
9
+ assignees:
10
+ - sue445
@@ -0,0 +1,59 @@
1
+ # Simple workflow for deploying static content to GitHub Pages
2
+ name: Deploy static content to Pages
3
+
4
+ on:
5
+ # Runs on pushes targeting the default branch
6
+ push:
7
+ branches:
8
+ - master
9
+
10
+ # Allows you to run this workflow manually from the Actions tab
11
+ workflow_dispatch:
12
+
13
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14
+ permissions:
15
+ contents: read
16
+ pages: write
17
+ id-token: write
18
+
19
+ # Allow one concurrent deployment
20
+ concurrency:
21
+ group: "pages"
22
+ cancel-in-progress: true
23
+
24
+ jobs:
25
+ # Single deploy job since we're just deploying
26
+ deploy:
27
+ environment:
28
+ name: github-pages
29
+ url: ${{ steps.deployment.outputs.page_url }}
30
+ runs-on: ubuntu-latest
31
+ steps:
32
+ - name: Checkout
33
+ uses: actions/checkout@v4
34
+
35
+ - uses: ruby/setup-ruby@v1
36
+ with:
37
+ ruby-version: ruby
38
+ bundler-cache: true
39
+
40
+ - run: bundle exec yard
41
+
42
+ - name: Setup Pages
43
+ uses: actions/configure-pages@v5
44
+ - name: Upload artifact
45
+ uses: actions/upload-pages-artifact@v3
46
+ with:
47
+ # Upload entire repository
48
+ path: './doc'
49
+ - name: Deploy to GitHub Pages
50
+ id: deployment
51
+ uses: actions/deploy-pages@main
52
+
53
+ - name: Slack Notification (not success)
54
+ uses: act10ns/slack@v2
55
+ if: "! success()"
56
+ continue-on-error: true
57
+ with:
58
+ status: ${{ job.status }}
59
+ webhook-url: ${{ secrets.SLACK_WEBHOOK }}
@@ -12,49 +12,31 @@ 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
21
18
 
22
- container: ${{ matrix.ruby }}
23
-
24
19
  strategy:
25
20
  fail-fast: false
26
21
 
27
22
  matrix:
28
23
  ruby:
29
- - ruby:2.5
30
- - ruby:2.6
31
- - ruby:2.7
32
- - ruby:3.0
33
- - rubylang/ruby:master-nightly-bionic
34
- include:
35
- - ruby: rubylang/ruby:master-nightly-bionic
36
- allow_failures: "true"
24
+ - "2.6"
25
+ - "2.7"
26
+ - "3.0"
27
+ - "3.1"
28
+ - "3.2"
29
+ - "3.3"
37
30
 
38
31
  steps:
39
- - uses: actions/checkout@v2
32
+ - uses: actions/checkout@v4
40
33
 
41
-
42
- - name: Cache vendor/bundle
43
- uses: actions/cache@v1
44
- id: cache_gem
34
+ - uses: ruby/setup-ruby@v1
45
35
  with:
46
- path: vendor/bundle
47
- key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ github.sha }}
48
- restore-keys: |
49
- v1-gem-${{ runner.os }}-${{ matrix.ruby }}-
50
- continue-on-error: ${{ matrix.allow_failures == 'true' }}
36
+ ruby-version: ${{ matrix.ruby }}
37
+ bundler-cache: true
51
38
 
52
- - name: bundle update
53
- run: |
54
- set -xe
55
- bundle config path vendor/bundle
56
- bundle update --jobs $(nproc) --retry 3
57
- continue-on-error: ${{ matrix.allow_failures == 'true' }}
39
+ - run: bundle update --jobs $(nproc) --retry 3
58
40
 
59
41
  - name: Setup Code Climate Test Reporter
60
42
  uses: aktions/codeclimate-test-reporter@v1
@@ -69,12 +51,8 @@ jobs:
69
51
  git config --global user.email "github-runner@example.com"
70
52
  git config --global user.name "github runner"
71
53
 
72
- - name: Run test
73
- run: |
74
- set -xe
75
- bundle exec rspec
76
- bundle exec rubocop -P
77
- continue-on-error: ${{ matrix.allow_failures == 'true' }}
54
+ - run: bundle exec rspec
55
+ - run: bundle exec rubocop -P
78
56
 
79
57
  - name: Teardown Code Climate Test Reporter
80
58
  uses: aktions/codeclimate-test-reporter@v1
@@ -84,15 +62,13 @@ jobs:
84
62
  continue-on-error: true
85
63
 
86
64
  - name: Slack Notification (not success)
87
- uses: lazy-actions/slatify@master
65
+ uses: act10ns/slack@v2
88
66
  if: "! success()"
89
67
  continue-on-error: true
90
68
  with:
91
- job_name: ${{ format('*build* ({0})', matrix.ruby) }}
92
- type: ${{ job.status }}
93
- icon_emoji: ":octocat:"
94
- url: ${{ secrets.SLACK_WEBHOOK }}
95
- token: ${{ secrets.GITHUB_TOKEN }}
69
+ status: ${{ job.status }}
70
+ webhook-url: ${{ secrets.SLACK_WEBHOOK }}
71
+ matrix: ${{ toJson(matrix) }}
96
72
 
97
73
  notify:
98
74
  needs:
@@ -102,12 +78,9 @@ jobs:
102
78
 
103
79
  steps:
104
80
  - name: Slack Notification (success)
105
- uses: lazy-actions/slatify@master
81
+ uses: act10ns/slack@v2
106
82
  if: always()
107
83
  continue-on-error: true
108
84
  with:
109
- job_name: '*build*'
110
- type: ${{ job.status }}
111
- icon_emoji: ":octocat:"
112
- url: ${{ secrets.SLACK_WEBHOOK }}
113
- token: ${{ secrets.GITHUB_TOKEN }}
85
+ status: ${{ job.status }}
86
+ webhook-url: ${{ secrets.SLACK_WEBHOOK }}
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/**/*'
@@ -13,6 +13,9 @@ AllCops:
13
13
  NewCops: enable
14
14
  SuggestExtensions: false
15
15
 
16
+ Gemspec/DevelopmentDependencies:
17
+ EnforcedStyle: gemspec
18
+
16
19
  Metrics/BlockLength:
17
20
  Exclude:
18
21
  - '*.gemspec'
data/.yardopts ADDED
@@ -0,0 +1,2 @@
1
+ --markup markdown
2
+ --no-private
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
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.5...master)
3
+
4
+ ## v0.4.5
5
+ [full changelog](http://github.com/sue445/rubocop_auto_corrector/compare/v0.4.4...v0.4.5)
6
+
7
+ * Requires rubocop 1.30.0+
8
+ * https://github.com/sue445/rubocop_auto_corrector/pull/67
9
+
10
+ ## v0.4.4
11
+ [full changelog](http://github.com/sue445/rubocop_auto_corrector/compare/v0.4.3...v0.4.4)
12
+
13
+ * Migrate to `--autocorrect` and requires rubocop 1.3.0+
14
+ * https://github.com/sue445/rubocop_auto_corrector/pull/48
15
+ * `--auto-correct-count` is deprecated, use `--autocorrect-count`
3
16
 
4
17
  ## v0.4.3
5
18
  [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.5'
5
5
  end
@@ -10,22 +10,16 @@ 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
 
18
- # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
19
- # to allow pushing to a single host or delete this section to allow pushing to any host.
20
- if spec.respond_to?(:metadata)
21
- spec.metadata['homepage_uri'] = spec.homepage
22
- spec.metadata['source_code_uri'] = spec.homepage
23
- spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/master/CHANGELOG.md"
24
- spec.metadata['rubygems_mfa_required'] = 'true'
25
- else
26
- raise 'RubyGems 2.0 or newer is required to protect against ' \
27
- 'public gem pushes.'
28
- end
18
+ spec.metadata['homepage_uri'] = spec.homepage
19
+ spec.metadata['source_code_uri'] = spec.homepage
20
+ spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/master/CHANGELOG.md"
21
+ spec.metadata['documentation_uri'] = 'https://sue445.github.io/rubocop_auto_corrector/'
22
+ spec.metadata['rubygems_mfa_required'] = 'true'
29
23
 
30
24
  # Specify which files should be added to the gem when it is released.
31
25
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -36,12 +30,12 @@ Gem::Specification.new do |spec|
36
30
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
31
  spec.require_paths = ['lib']
38
32
 
39
- spec.required_ruby_version = '>= 2.5.0'
33
+ spec.required_ruby_version = '>= 2.6.0'
40
34
 
41
- spec.add_dependency 'rubocop', '>= 1.13.0'
35
+ spec.add_dependency 'rubocop', '>= 1.30.0'
42
36
 
43
37
  spec.add_development_dependency 'bundler', '>= 1.17'
44
- spec.add_development_dependency 'coveralls'
38
+ spec.add_development_dependency 'coveralls_reborn'
45
39
  spec.add_development_dependency 'rake'
46
40
  spec.add_development_dependency 'rspec', '~> 3.0'
47
41
  spec.add_development_dependency 'rspec-parameterized'
@@ -50,4 +44,5 @@ Gem::Specification.new do |spec|
50
44
  spec.add_development_dependency 'rubocop-rspec'
51
45
  spec.add_development_dependency 'simplecov', '< 0.18.0'
52
46
  spec.add_development_dependency 'unparser', '>= 0.4.5'
47
+ spec.add_development_dependency 'yard'
53
48
  end
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.5
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: 2024-05-14 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.30.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.30.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.17'
41
41
  - !ruby/object:Gem::Dependency
42
- name: coveralls
42
+ name: coveralls_reborn
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -164,7 +164,21 @@ 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
+ - !ruby/object:Gem::Dependency
168
+ name: yard
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ description: Run `rubocop --autocorrect && git commit` with each cop.
168
182
  email:
169
183
  - sue445@sue445.net
170
184
  executables:
@@ -173,10 +187,13 @@ extensions: []
173
187
  extra_rdoc_files: []
174
188
  files:
175
189
  - ".coveralls.yml"
190
+ - ".github/dependabot.yml"
191
+ - ".github/workflows/pages.yml"
176
192
  - ".github/workflows/test.yml"
177
193
  - ".gitignore"
178
194
  - ".rspec"
179
195
  - ".rubocop.yml"
196
+ - ".yardopts"
180
197
  - CHANGELOG.md
181
198
  - Gemfile
182
199
  - LICENSE.txt
@@ -198,6 +215,7 @@ metadata:
198
215
  homepage_uri: https://github.com/sue445/rubocop_auto_corrector
199
216
  source_code_uri: https://github.com/sue445/rubocop_auto_corrector
200
217
  changelog_uri: https://github.com/sue445/rubocop_auto_corrector/blob/master/CHANGELOG.md
218
+ documentation_uri: https://sue445.github.io/rubocop_auto_corrector/
201
219
  rubygems_mfa_required: 'true'
202
220
  post_install_message:
203
221
  rdoc_options: []
@@ -207,15 +225,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
207
225
  requirements:
208
226
  - - ">="
209
227
  - !ruby/object:Gem::Version
210
- version: 2.5.0
228
+ version: 2.6.0
211
229
  required_rubygems_version: !ruby/object:Gem::Requirement
212
230
  requirements:
213
231
  - - ">="
214
232
  - !ruby/object:Gem::Version
215
233
  version: '0'
216
234
  requirements: []
217
- rubygems_version: 3.2.22
235
+ rubygems_version: 3.5.9
218
236
  signing_key:
219
237
  specification_version: 4
220
- summary: Run `rubocop --auto-correct && git commit` with each cop.
238
+ summary: Run `rubocop --autocorrect && git commit` with each cop.
221
239
  test_files: []