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

[#5451]: When using --auto-gen-config, do not ouput offenses unless the --output-offenses flag is also passed #5727

Merged
merged 1 commit into from
Apr 16, 2018

Conversation

drewpterry
Copy link
Contributor

@drewpterry drewpterry commented Mar 26, 2018

#5451

As mentioned in the issue running rubocop with the --auto-gen-config option currently displays all offenses in the console, which is not particularly useful for this feature, especially when being run over large code bases.

This makes it so that --auto-gen-config will not output offenses to the
console by default.

Additionally, a flag of --output-offenses is also added which can be
used in conjuction with the auto-gen-config command to output offenses
to the console if needed.


Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title
    and description in grammatically correct, complete sentences.
  • Run rake default or rake parallel. It executes all tests and RuboCop for itself, and generates the documentation.

@drewpterry drewpterry changed the title * [#5451]: When using --auto-gen-config, do not ouput offenses unless the --output-offenses flag is also passed [#5451]: When using --auto-gen-config, do not ouput offenses unless the --output-offenses flag is also passed Mar 26, 2018
@Drenmi
Copy link
Collaborator

Drenmi commented Mar 27, 2018

Good call using a custom formatter. Looks reasonable to me.

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 3, 2018

I think there was also some documentation of the formatters in the manual, that should probably be updated.

I'd also name --output-offenses to --display-offenses, as it seems like a better name to me. In general I'm not quite certain that we need this option at all, but I guess doesn't hurt to have it.

…ouput offenses.

This makes it so that --auto-gen-config will not output offenses to the console by default.
@drewpterry
Copy link
Contributor Author

@Drenmi @bbatsov

Thanks for taking a look!

I decided to remove the --output-offenses option completely since I was unsure of including it initially as well and I don't think it's worth adding extra code for it unless some other users explicitly ask for it.

Additionally I added some documentation in the formatters manual as suggested.

@bbatsov bbatsov merged commit 9645bea into rubocop:master Apr 16, 2018
@bbatsov
Copy link
Collaborator

bbatsov commented Apr 16, 2018

👍

@drewpterry drewpterry deleted the autoconfig-no-output branch May 7, 2018 11:04
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.

None yet

3 participants