pronto-rubocop 0.11.5 → 0.11.6

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: 31a6b1d783a13213827c18f9b43e4abeb8059eeb5f03327932ab4adddb4a605e
4
- data.tar.gz: f6c46e2ec733ae8e6734f6c8b5ad0e6960a4cf7ab084ac5ef9b9c1c522f6f9a2
3
+ metadata.gz: d192df5adbb4e399dd56d3c202eeb325d73b456567eb7b6db846b5168f0c1045
4
+ data.tar.gz: b1444cc4f6f915a547d0e43be5622fa7df6b889837da2e09474d0f864a5f741b
5
5
  SHA512:
6
- metadata.gz: 8334a6dcde6ea5160695f8ec9104f74bdd81b5e9d3f67dd4ed7dbd19d4ccec6f843832449141996012cac311a1e653e1e3957614ee7145c024fb5689d31c2f76
7
- data.tar.gz: de20031af59547eb5c717a03943086267cfa6efef577bd604d817e32e85b9c5136f6826ae08a806bc51c03be114a1d89f8d487d4b95ac511c6668e427d7b23cf
6
+ metadata.gz: 71f72f153f848cb90592bf2fe635f1bd32d0ba2749b0e095e645ea8b5f570be2e90b412a3eae40a71a4a01f330e1359ceb1fc36406433080dac383ece83e5d9f
7
+ data.tar.gz: a5b07e6280f14dd884f76a2f9a9ec8318a48fc0696cf4ecd075f24174531c0ecaf70616c28faf637b6f01f5f9869891469d93831dea5df113169fe7b14d722c3
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: 'github-actions'
4
+ directory: '/'
5
+ schedule:
6
+ interval: 'weekly'
@@ -14,7 +14,7 @@ jobs:
14
14
  runs-on: ubuntu-latest
15
15
  strategy:
16
16
  matrix:
17
- ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2']
17
+ ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3', '3.4']
18
18
  rubocop: ['0.63.1', '0.81.0', '0.84.0', '0.85.0', '0.86.0', '0.87.0', '< 1.0', '1.0.0', '1.29.1', '1.30.0', '1.38.0', '< 2.0']
19
19
  include:
20
20
  - ruby: '2.3'
@@ -36,7 +36,7 @@ jobs:
36
36
  rubocop: '1.38.0'
37
37
  fail-fast: false
38
38
  steps:
39
- - uses: actions/checkout@v3
39
+ - uses: actions/checkout@v4
40
40
  - name: use specific rubocop version
41
41
  run: echo "gem 'rubocop', '${{ matrix.rubocop }}'" > Gemfile.local
42
42
  - name: use specific rubocop-ast version (if required)
@@ -0,0 +1,32 @@
1
+ name: Publish gem to rubygems.org
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ push:
13
+ if: github.repository == 'prontolabs/pronto-rubocop'
14
+ runs-on: ubuntu-latest
15
+
16
+ permissions:
17
+ contents: write
18
+ id-token: write
19
+
20
+ steps:
21
+ - uses: step-security/harden-runner@c95a14d0e5bab51a9f56296a4eb0e416910cd350 # v2.10.3
22
+ with:
23
+ egress-policy: audit
24
+
25
+ - uses: actions/checkout@cbb722410c2e876e24abbe8de2cc27693e501dcb # v4.2.2
26
+
27
+ - uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 # v1.207.0
28
+ with:
29
+ bundler-cache: true
30
+ ruby-version: '3.4'
31
+
32
+ - uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Pronto runner for RuboCop
2
2
 
3
- [![Code Climate](https://codeclimate.com/github/prontolabs/pronto-rubocop.png)](https://codeclimate.com/github/prontolabs/pronto-rubocop)
4
- [![Build Status](https://travis-ci.org/prontolabs/pronto-rubocop.svg?branch=master)](https://travis-ci.org/prontolabs/pronto-rubocop)
5
3
  [![Gem Version](https://badge.fury.io/rb/pronto-rubocop.png)](http://badge.fury.io/rb/pronto-rubocop)
4
+ [![Build Status](https://github.com/prontolabs/pronto-rubocop/actions/workflows/checks.yml/badge.svg)](https://github.com/prontolabs/pronto-rubocop/actions/workflows/checks.yml)
5
+ [![Code Climate](https://codeclimate.com/github/prontolabs/pronto-rubocop.png)](https://codeclimate.com/github/prontolabs/pronto-rubocop)
6
6
 
7
7
  Pronto runner for [RuboCop](https://github.com/bbatsov/rubocop), ruby code
8
8
  analyzer. [What is Pronto?](https://github.com/prontolabs/pronto)
@@ -31,7 +31,7 @@ module Pronto
31
31
  end
32
32
 
33
33
  def registry
34
- @registry ||= ::RuboCop::Cop::Registry.new(RuboCop::Cop::Cop.all)
34
+ @registry ||= ::RuboCop::Cop::Registry.new(all_cops)
35
35
  end
36
36
 
37
37
  def rubocop_config
@@ -46,11 +46,20 @@ module Pronto
46
46
 
47
47
  attr_reader :patch
48
48
 
49
+ def all_cops
50
+ # keep support of older Rubocop versions
51
+ if RuboCop::Cop.const_defined?(:Registry) && RuboCop::Cop::Registry.respond_to?(:all)
52
+ RuboCop::Cop::Registry.all
53
+ else
54
+ RuboCop::Cop::Cop.all
55
+ end
56
+ end
57
+
49
58
  def valid?
50
59
  return false if rubocop_config.file_to_exclude?(path)
51
60
  return true if rubocop_config.file_to_include?(path)
52
61
 
53
- true
62
+ runner.ruby_file?(path)
54
63
  end
55
64
 
56
65
  def path
@@ -58,8 +67,14 @@ module Pronto
58
67
  end
59
68
 
60
69
  def offenses
61
- team
62
- .inspect_file(processed_source)
70
+ # keep support of older Rubocop versions
71
+ if team.respond_to?(:investigate)
72
+ offenses = team.investigate(processed_source).offenses
73
+ else
74
+ offenses = team.inspect_file(processed_source)
75
+ end
76
+
77
+ offenses
63
78
  .sort
64
79
  .reject(&:disabled?)
65
80
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Pronto
4
4
  module RubocopVersion
5
- VERSION = '0.11.5'
5
+ VERSION = '0.11.6'
6
6
  end
7
7
  end
@@ -8,7 +8,9 @@ require 'pronto/rubocop/offense_line'
8
8
  module Pronto
9
9
  class Rubocop < Runner
10
10
  def run
11
- ruby_patches
11
+ return [] unless @patches
12
+
13
+ @patches
12
14
  .select { |patch| patch.additions.positive? }
13
15
  .flat_map { |patch| PatchCop.new(patch, self).messages }
14
16
  end
@@ -10,12 +10,11 @@ Gem::Specification.new do |s|
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.author = 'Mindaugas Mozūras'
12
12
  s.email = 'mindaugas.mozuras@gmail.com'
13
- s.homepage = 'http://github.com/mmozuras/pronto-rubocop'
13
+ s.homepage = 'https://github.com/prontolabs/pronto-rubocop'
14
14
  s.summary = 'Pronto runner for Rubocop, ruby code analyzer'
15
15
 
16
16
  s.licenses = ['MIT']
17
17
  s.required_ruby_version = '>= 2.3.0'
18
- s.rubygems_version = '1.8.23'
19
18
 
20
19
  s.files = `git ls-files`.split($RS).reject do |file|
21
20
  file =~ %r{^(?:
@@ -34,6 +33,7 @@ Gem::Specification.new do |s|
34
33
 
35
34
  s.add_runtime_dependency('pronto', '~> 0.11.0')
36
35
  s.add_runtime_dependency('rubocop', '>= 0.63.1', '< 2.0')
36
+ s.add_development_dependency('base64', '~> 0.1.2')
37
37
  s.add_development_dependency('rake', '~> 12.0')
38
38
  s.add_development_dependency('rspec', '~> 3.4')
39
39
  s.add_development_dependency('rspec-its', '~> 1.2')
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto-rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.5
4
+ version: 0.11.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mindaugas Mozūras
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-01-20 00:00:00.000000000 Z
10
+ date: 2025-01-11 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: pronto
@@ -44,6 +43,20 @@ dependencies:
44
43
  - - "<"
45
44
  - !ruby/object:Gem::Version
46
45
  version: '2.0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: base64
48
+ requirement: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: 0.1.2
53
+ type: :development
54
+ prerelease: false
55
+ version_requirements: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: 0.1.2
47
60
  - !ruby/object:Gem::Dependency
48
61
  name: rake
49
62
  requirement: !ruby/object:Gem::Requirement
@@ -86,7 +99,6 @@ dependencies:
86
99
  - - "~>"
87
100
  - !ruby/object:Gem::Version
88
101
  version: '1.2'
89
- description:
90
102
  email: mindaugas.mozuras@gmail.com
91
103
  executables: []
92
104
  extensions: []
@@ -95,7 +107,9 @@ extra_rdoc_files:
95
107
  - README.md
96
108
  files:
97
109
  - ".github/CODEOWNERS"
110
+ - ".github/dependabot.yml"
98
111
  - ".github/workflows/checks.yml"
112
+ - ".github/workflows/push_gem.yml"
99
113
  - LICENSE
100
114
  - README.md
101
115
  - lib/pronto/rubocop.rb
@@ -103,11 +117,10 @@ files:
103
117
  - lib/pronto/rubocop/patch_cop.rb
104
118
  - lib/pronto/rubocop/version.rb
105
119
  - pronto-rubocop.gemspec
106
- homepage: http://github.com/mmozuras/pronto-rubocop
120
+ homepage: https://github.com/prontolabs/pronto-rubocop
107
121
  licenses:
108
122
  - MIT
109
123
  metadata: {}
110
- post_install_message:
111
124
  rdoc_options: []
112
125
  require_paths:
113
126
  - lib
@@ -122,8 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
135
  - !ruby/object:Gem::Version
123
136
  version: '0'
124
137
  requirements: []
125
- rubygems_version: 3.1.2
126
- signing_key:
138
+ rubygems_version: 3.6.2
127
139
  specification_version: 4
128
140
  summary: Pronto runner for Rubocop, ruby code analyzer
129
141
  test_files: []