rubocop-checkstyle_formatter 0.6.0 → 0.6.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 15fd148d5deef613d0eb8741b473fc511646037417c2d989937e339cdf1240db
|
|
4
|
+
data.tar.gz: 532860a16b4e8e2c2f7382792546e1387497564d21d151a053afa8e7eae7bb08
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62aca9b772476e718a315223472537bea2532afd25ad6fc1e4c861ac305e84400618e443c5d00fc17caacf918cb6b0d6577fff9f74194c1482c8557d8e807ec0
|
|
7
|
+
data.tar.gz: 32919d8fbca2a1a8db84ef628193bf2f8e5f5ba766c2f2d19b5a62b78418aee9d55f03c482fbefd8e37ee4066e4b7b33d2b552c87f0a426cfe098ca1835f7d5a
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: ..
|
|
3
3
|
specs:
|
|
4
|
-
rubocop-checkstyle_formatter (0.6.
|
|
4
|
+
rubocop-checkstyle_formatter (0.6.1)
|
|
5
5
|
rubocop (>= 1.14.0)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
@@ -50,6 +50,7 @@ GEM
|
|
|
50
50
|
|
|
51
51
|
PLATFORMS
|
|
52
52
|
universal-java-11
|
|
53
|
+
x86_64-darwin-25
|
|
53
54
|
x86_64-linux
|
|
54
55
|
|
|
55
56
|
DEPENDENCIES
|
|
@@ -61,4 +62,4 @@ DEPENDENCIES
|
|
|
61
62
|
rubocop-checkstyle_formatter!
|
|
62
63
|
|
|
63
64
|
BUNDLED WITH
|
|
64
|
-
2.
|
|
65
|
+
2.5.5
|
|
@@ -6,7 +6,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |gem|
|
|
8
8
|
gem.name = 'rubocop-checkstyle_formatter'
|
|
9
|
-
gem.version = '0.6.
|
|
9
|
+
gem.version = '0.6.1'
|
|
10
10
|
gem.authors = ['Eito Katagiri']
|
|
11
11
|
gem.email = ['eitoball@gmail.com']
|
|
12
12
|
gem.description = 'A formatter for rubocop that outputs in checkstyle format'
|
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
|
|
|
14
14
|
gem.homepage = 'https://github.com/eitoball/rubocop-checkstyle_formatter'
|
|
15
15
|
gem.license = 'MIT'
|
|
16
16
|
|
|
17
|
-
gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
|
17
|
+
gem.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR).grep_v(%r{^spec/})
|
|
18
18
|
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
|
19
19
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
20
20
|
gem.require_paths = ['lib']
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubocop-checkstyle_formatter
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eito Katagiri
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-05-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rubocop
|
|
@@ -122,8 +122,6 @@ files:
|
|
|
122
122
|
- gemfiles/rubocop_1.30.1.gemfile.lock
|
|
123
123
|
- lib/rubocop/formatter/checkstyle_formatter.rb
|
|
124
124
|
- rubocop-checkstyle_formatter.gemspec
|
|
125
|
-
- spec/rubocop/formatter/checkstyle_formatter_spec.rb
|
|
126
|
-
- spec/spec_helper.rb
|
|
127
125
|
homepage: https://github.com/eitoball/rubocop-checkstyle_formatter
|
|
128
126
|
licenses:
|
|
129
127
|
- MIT
|
|
@@ -143,10 +141,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
143
141
|
- !ruby/object:Gem::Version
|
|
144
142
|
version: '0'
|
|
145
143
|
requirements: []
|
|
146
|
-
rubygems_version: 3.3.
|
|
144
|
+
rubygems_version: 3.0.3.1
|
|
147
145
|
signing_key:
|
|
148
146
|
specification_version: 4
|
|
149
147
|
summary: A formatter for rubocop that outputs in checkstyle format
|
|
150
|
-
test_files:
|
|
151
|
-
- spec/rubocop/formatter/checkstyle_formatter_spec.rb
|
|
152
|
-
- spec/spec_helper.rb
|
|
148
|
+
test_files: []
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
|
-
|
|
3
|
-
require 'spec_helper'
|
|
4
|
-
require 'stringio'
|
|
5
|
-
require 'rexml/document'
|
|
6
|
-
|
|
7
|
-
module RuboCop
|
|
8
|
-
module Formatter
|
|
9
|
-
describe CheckstyleFormatter do
|
|
10
|
-
let(:severities) { %i[refactor convention warning error fatal] }
|
|
11
|
-
let(:cop) do
|
|
12
|
-
Cop::Cop.new.tap do |c|
|
|
13
|
-
c.send(:begin_investigation, RuboCop::ProcessedSource.new(file, 2.7, 'sample.rb'))
|
|
14
|
-
source_buffer = Parser::Source::Buffer.new('sample.rb', 1).tap { |b| b.source = '' }
|
|
15
|
-
severities.each_with_index do |severity, index|
|
|
16
|
-
c.add_offense(nil, location: Parser::Source::Range.new(source_buffer, 0, index), message: severity.to_s)
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
let(:output) { StringIO.new }
|
|
21
|
-
let(:file) { File.join(Dir.pwd, 'sample.rb') }
|
|
22
|
-
|
|
23
|
-
before do
|
|
24
|
-
formatter = described_class.new(output)
|
|
25
|
-
formatter.started(file)
|
|
26
|
-
formatter.file_finished(file, cop.respond_to?(:offenses) ? cop.offenses : cop.offences)
|
|
27
|
-
formatter.finished([file])
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
it 'should convert rubocop severity to checkstyle severity' do
|
|
31
|
-
doc = REXML::Document.new(output.string)
|
|
32
|
-
REXML::XPath.match(doc, '/checkstyle/file').each do |file|
|
|
33
|
-
if defined?(PathUtil)
|
|
34
|
-
expect(file.attribute('name').value).to eq('sample.rb')
|
|
35
|
-
end
|
|
36
|
-
REXML::XPath.match(file, '/error').each do |error|
|
|
37
|
-
message = error.attribute('message').value
|
|
38
|
-
severity = error.attribute('severity').value
|
|
39
|
-
case message
|
|
40
|
-
when 'refactor', 'convention' then expect(severity).to eq('info')
|
|
41
|
-
when 'warning' then expect(severity).to eq('warning')
|
|
42
|
-
when 'error', 'fatal' then expect(severity).to eq('error')
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
context 'RUBOCOP_CHECKSTYLE_FORMATTER_ABSOLUTE_PATH is defined' do
|
|
49
|
-
around do |example|
|
|
50
|
-
ENV['RUBOCOP_CHECKSTYLE_FORMATTER_ABSOLUTE_PATH'] = 'true'
|
|
51
|
-
example.run
|
|
52
|
-
ENV.delete('RUBOCOP_CHECKSTYLE_FORMATTER_ABSOLUTE_PATH')
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
it 'should use absolute path in name attribute of file tag' do
|
|
56
|
-
output = StringIO.new
|
|
57
|
-
formatter = described_class.new(output)
|
|
58
|
-
formatter.started(file)
|
|
59
|
-
formatter.file_finished(file, cop.respond_to?(:offenses) ? cop.offenses : cop.offences)
|
|
60
|
-
formatter.finished([file])
|
|
61
|
-
doc = REXML::Document.new(output.string)
|
|
62
|
-
file = REXML::XPath.first(doc, '/checkstyle/file')
|
|
63
|
-
expect(Pathname.new(file.attributes['name'])).to be_absolute
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
end
|