-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to checkstyle #34
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -199,10 +199,34 @@ def details(yaml_lines) | |
end | ||
end | ||
|
||
class CheckStyle < Base | ||
def file_contents_to_failures(str) | ||
xml = REXML::Document.new(str) | ||
xml.elements.enum_for(:each, '//file').flat_map do |file| | ||
file_name = file.attribute('name').value | ||
|
||
file.elements.map do |error| | ||
severity = error.attribute('severity').value | ||
source = error.attribute('source').value | ||
line_num = error.attribute('line').value | ||
location = "#{file_name}:#{line_num}" | ||
message = error.attribute('message').value | ||
|
||
Failure::Structured.new( | ||
summary: "[#{severity}] #{source} @ #{location}", | ||
message: message, | ||
details: location | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Failure::Structured.new(
summary: "[#{severity}] #{location}: #{message}"
details: source
) |
||
) | ||
end | ||
end | ||
end | ||
end | ||
|
||
TYPES = { | ||
oneline: Input::OneLine, | ||
junit: Input::JUnit, | ||
tap: Input::Tap | ||
tap: Input::Tap, | ||
checkStyle: Input::CheckStyle | ||
}.freeze | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<checkstyle version="8.0"> | ||
<file name="src/main/java/io/timnew/sol/Sol.kt"> | ||
<error line="106" column="1" severity="error" message="Needless blank line(s)" source="no-consecutive-blank-lines" /> | ||
</file> | ||
</checkstyle> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add the column here as well?