Skip to content
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 printing total count when rubocop --format offences #793

Merged
merged 1 commit into from
Feb 4, 2014

Conversation

ma2gedev
Copy link
Contributor

@ma2gedev ma2gedev commented Feb 4, 2014

I would like to know total count when rubocop --format offences so print total offence counts.

BEFORE

1  Proc
1  WordArray

AFTER

1  Proc
1  WordArray
--
2  Total

@yujinakayama
Copy link
Collaborator

Though I'm on the fence about this, originally the offence count formatter was intended to be used together with another formatter like:

# Use both progress formatter (the default) and offence count formatter
$ rubocop -fp -fo
# ...
spec/unit/presenter_spec.rb:116:61: C: Place the . on the next line, together with the method name.
        expect(StringUtils).to have_received(:wrap_with_sgr).
                                                            ^

21 files inspected, 73 offences detected

32  DotPosition
17  SingleLineMethods
15  EmptyLineBetweenDefs
2   LineLength
2   TrailingComma
2   AlignParameters
2   MethodLength
1   CyclomaticComplexity

@bbatsov
Copy link
Collaborator

bbatsov commented Feb 4, 2014

@yujinakayama I guess you should extend the documentation on formatter, since outside of you, me and @jonas054 most people probably don't know they can chain formatters.

@yujinakayama
Copy link
Collaborator

@bbatsov Sure. In fact it's described in the text of --help, but it's obscure.

By the way, after my first reaction, I tend to agree this change now. It would be useful if the formatter can be used alone also, and I don't think it's too verbose even if it's combined with another formatter:

21 files inspected, 73 offences detected

32  DotPosition
17  SingleLineMethods
15  EmptyLineBetweenDefs
2   LineLength
2   TrailingComma
2   AlignParameters
2   MethodLength
1   CyclomaticComplexity
--
73  Total

@bbatsov
Copy link
Collaborator

bbatsov commented Feb 4, 2014

@yujinakayama OK.

@ma2gedev Update the changelog and squash all commits into one.

@ma2gedev
Copy link
Contributor Author

ma2gedev commented Feb 4, 2014

Thanks for explain background about offence count formatter, I understood it.

@ma2gedev
Copy link
Contributor Author

ma2gedev commented Feb 4, 2014

I squashed all commits with the changelog.

@@ -4,6 +4,7 @@

### Bugs fixed

* [#793](https://github.com/bbatsov/rubocop/issues/793): Add printing total count when `rubocop --format offences`. ([@ma2gedev][])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be in a section "Changes". You should also add your github handle to the bottom of the changelog.

@bbatsov
Copy link
Collaborator

bbatsov commented Feb 4, 2014

The README and the relevant spec should also be updated.

- BEFORE
1  Proc
1  WordArray

- AFTER
1  Proc
1  WordArray
--
2  Total
@ma2gedev
Copy link
Contributor Author

ma2gedev commented Feb 4, 2014

Thanks for mentoring me. I updated the changelog, spec and README.

bbatsov added a commit that referenced this pull request Feb 4, 2014
Add printing total count when `rubocop --format offences`
@bbatsov bbatsov merged commit 145fe66 into rubocop:master Feb 4, 2014
@bbatsov
Copy link
Collaborator

bbatsov commented Feb 4, 2014

@ma2gedev You're welcome. Thanks for your contribution!

@ma2gedev ma2gedev deleted the total_count branch February 4, 2014 15:12
@ma2gedev
Copy link
Contributor Author

ma2gedev commented Feb 4, 2014

@bbatsov Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants