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
New option --display-only-failed for junit format #8050
New option --display-only-failed for junit format #8050
Conversation
spec/rubocop/options_spec.rb
Outdated
.to raise_error(RuboCop::OptionArgumentError) | ||
end | ||
|
||
it 'works if given with --format json' do |
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.
I guess you meant to write junit here.
spec/rubocop/options_spec.rb
Outdated
@@ -92,6 +92,8 @@ def abs(path) | |||
This option applies to the previously | |||
specified --format, or the default format | |||
if no format is specified. | |||
--display-only-failed Only output offense messages. Omit passing | |||
cops. Only valid for --format junit |
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.
You forgot the final .
I'm fine with the proposed change. I think it'd be a good idea to also mention it here https://docs.rubocop.org/rubocop/formatters.html#junit-style-formatter |
Corrected the two specific issues and updated the relevant documentation. I love this tool, @bbatsov, thank you! |
e839032
to
7600a3c
Compare
Speeds up test report processing for large codebases and helps address the sorts of concerns raised at mikian/rubocop-junit-formatter#18. Refactors file_finished method in junit_formatter.rb to reduce complexity. Fixes buggy error message when --disable-uncorrectable is run without --auto-correct, which I noticed because I added similar error messaging when you try to run --display-only-failed without --format junit Tests, CHANGELOG.md, doc updates, and help message updates to accompany new option.
7600a3c
to
b6f775a
Compare
@@ -242,7 +242,7 @@ The JSON structure is like the following example: | |||
**Machine-parsable** | |||
|
|||
The `junit` style formatter provides the JUnit formatting. | |||
This formatter is based on [rubocop-junit-formatter gem](https://github.com/mikian/rubocop-junit-formatter). | |||
This formatter is based on the [rubocop-junit-formatter gem](https://github.com/mikian/rubocop-junit-formatter). |
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.
You didn't make the same edit to the actual docs. There's no need to touch the markdown files - they will be removed as soon as we setup permanent redirects between the old docs site that used them (powered by RTD) and the new one (docs.rubocop.org).
Thanks for tackling this! I'll do the small doc change I mentioned myself. |
Speeds up test report processing for large codebases and helps address
the sorts of concerns raised at
mikian/rubocop-junit-formatter#18.
In one case for me, this reduced the number of
testcase
xml elements from 66,000 to 1, which made a material difference in terms of jenkins test report load times.Refactors file_finished method in junit_formatter.rb to reduce
complexity.
Fixes buggy error message when --disable-uncorrectable is run without
--auto-correct, which I noticed because I added similar error messaging
when you try to run --display-only-failed without --format junit.
Tests, CHANGELOG.md, and help message updates to accompany new option