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 progress bar to offense formatter #5675

Merged
merged 1 commit into from Mar 18, 2018

Conversation

drewpterry
Copy link
Contributor

@drewpterry drewpterry commented Mar 13, 2018

When you run bundle exec rubocop --format offenses there is no output until rubocop has run completely. It is not very user friendly when run over large codebases where you might go a few minutes before rubocop shows any sign that it is indeed properly running.

This PR simply adds a progress bar so the user knows rubocop is running.


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.

@pocke
Copy link
Collaborator

pocke commented Mar 15, 2018

When you run bundle exec rubocop --format offenses there is no output until rubocop has run completely. It is not very user friendly when run over large codebases where you might go a few minutes before rubocop shows any sign that it is indeed properly running.

Definitely.

This PR simply adds a progress bar so the user knows rubocop is running.

Yeah, it's good idea. But I think the progress-bar should be hidden if the output is not a tty. I guess we would like to use the formatter output as an input of some program sometimes. For example: $ rubocop --format offenses | ruby -e 'do_something STDIN.read'
In this case, we do not need the progress-bar.

@drewpterry drewpterry force-pushed the offenses-running-indicator branch 3 times, most recently from d80a800 to 4463944 Compare March 17, 2018 16:03
@drewpterry
Copy link
Contributor Author

@pocke

But I think the progress-bar should be hidden if the output is not a tty.

That makes a lot of sense. I made the requested change!

@bbatsov bbatsov merged commit 3f81a25 into rubocop:master Mar 18, 2018
@bbatsov
Copy link
Collaborator

bbatsov commented Mar 18, 2018

Thanks for working on this! I really appreciate it! 🙇

@drewpterry drewpterry deleted the offenses-running-indicator branch March 18, 2018 04:56
This was referenced Mar 21, 2018
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