pronto-rubocop 0.11.1 → 0.11.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/checks.yml +13 -1
- data/lib/pronto/rubocop/offense_line.rb +7 -3
- data/lib/pronto/rubocop/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9966d2906f3d406926909048fe99e8814afa4b58e4a54963553652a1d502092b
|
4
|
+
data.tar.gz: d8be4f7a23e51f8c98debc7a41440289f34b2b11c3a52ae7af5507e8e628ff70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a69bc7d7de258f3bfe7b000b5d7a0c1dde7fa1075d0d665d7e695cf325fe6c4ff771178c7bc70b24c77175361fbd0320d33daa6d68415ee529efd3446c9b778f
|
7
|
+
data.tar.gz: 32042282d15f1e5b65c34efb771918f19a6db84dbcc4e6ce8d04dd54b21dee5131bc5f4a6893832eb30b2fe99ffff07ba021a338c0dbc999b57c9dd2ebc02d90
|
@@ -5,6 +5,9 @@ on:
|
|
5
5
|
branches: [ master ]
|
6
6
|
pull_request:
|
7
7
|
branches: [ master ]
|
8
|
+
workflow_dispatch:
|
9
|
+
schedule:
|
10
|
+
- cron: '0 6 * * 1' # 6am every Monday
|
8
11
|
|
9
12
|
jobs:
|
10
13
|
unit_tests:
|
@@ -12,12 +15,21 @@ jobs:
|
|
12
15
|
strategy:
|
13
16
|
matrix:
|
14
17
|
ruby: ['2.4', '2.5', '2.6', '2.7', '3.0']
|
15
|
-
rubocop: ['0.63.1', '0.81.0', '0.84.0', '0.85.0', '0.86.0', '0.87.0', '< 1.0', '1.0.0', '< 2.0']
|
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', '< 2.0']
|
16
19
|
include:
|
17
20
|
- ruby: '2.3'
|
18
21
|
rubocop: '0.63.1'
|
19
22
|
- ruby: '2.3'
|
20
23
|
rubocop: '0.81.0'
|
24
|
+
exclude:
|
25
|
+
- ruby: '2.4'
|
26
|
+
rubocop: '1.29.1'
|
27
|
+
- ruby: '2.4'
|
28
|
+
rubocop: '1.30.0'
|
29
|
+
- ruby: '2.5'
|
30
|
+
rubocop: '1.29.1'
|
31
|
+
- ruby: '2.5'
|
32
|
+
rubocop: '1.30.0'
|
21
33
|
fail-fast: false
|
22
34
|
steps:
|
23
35
|
- uses: actions/checkout@v2
|
@@ -56,6 +56,8 @@ module Pronto
|
|
56
56
|
if ::RuboCop::Cop::Team.respond_to?(:mobilize) && ::RuboCop::Cop::Team.public_method_defined?(:investigate)
|
57
57
|
# rubocop >= 0.87.0 has both mobilize and public investigate method
|
58
58
|
MOBILIZE = :mobilize
|
59
|
+
# rubocop 1.30.0 renamed from auto_correct to autocorrect
|
60
|
+
AUTOCORRECT = Gem::Version.new(::RuboCop::Version::STRING) >= Gem::Version.new("1.30.0") ? :autocorrect : :auto_correct
|
59
61
|
|
60
62
|
def report
|
61
63
|
@report ||= autocorrect_team.investigate(processed_source).cop_reports.first
|
@@ -66,11 +68,13 @@ module Pronto
|
|
66
68
|
end
|
67
69
|
|
68
70
|
def corrections_count
|
69
|
-
|
71
|
+
# Some lines may contain more than one offense
|
72
|
+
report.offenses.map(&:line).uniq.size
|
70
73
|
end
|
71
74
|
else
|
72
75
|
# rubocop 0.85.x and 0.86.0 have mobilize, older versions don't
|
73
76
|
MOBILIZE = ::RuboCop::Cop::Team.respond_to?(:mobilize) ? :mobilize : :new
|
77
|
+
AUTOCORRECT = :auto_correct
|
74
78
|
|
75
79
|
def corrector
|
76
80
|
@corrector ||= begin
|
@@ -91,8 +95,7 @@ module Pronto
|
|
91
95
|
::RuboCop::Cop::Team.send(MOBILIZE,
|
92
96
|
::RuboCop::Cop::Registry.new([cop_class]),
|
93
97
|
patch_cop.rubocop_config,
|
94
|
-
|
95
|
-
stdin: true)
|
98
|
+
**{ AUTOCORRECT => true, stdin: true })
|
96
99
|
end
|
97
100
|
|
98
101
|
def cop_class
|
@@ -117,6 +120,7 @@ module Pronto
|
|
117
120
|
end
|
118
121
|
|
119
122
|
DEFAULT_SEVERITIES = {
|
123
|
+
info: :info,
|
120
124
|
refactor: :warning,
|
121
125
|
convention: :warning,
|
122
126
|
warning: :warning,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pronto-rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mindaugas Mozūras
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pronto
|
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
122
|
- !ruby/object:Gem::Version
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
|
-
rubygems_version: 3.0.3
|
125
|
+
rubygems_version: 3.0.3.1
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Pronto runner for Rubocop, ruby code analyzer
|