Skip to content

Conversation

@sigmavirus24
Copy link

Sometimes the output of tox in addition to the output of the command(s)
tox is running can be a overwhelming and confusing. Allowing users to
silence tox's output is incredibly useful in focusing on the
command(s)'s output.

Resolves #256

Thanks for contributing a pull request!

If you are contributing for the first time or provide a trivial fix don't worry too
much about the checklist - we will help you get started.

Contribution checklist:

(also see CONTRIBUTING.rst for details)

  • wrote descriptive pull request text
  • added/updated test(s)
  • updated/extended the documentation
  • added relevant issue keyword
    in message body
  • added news fragment in changelog folder
    • fragment name: <issue number>.<type>.rst for example (588.bugfix.rst)
    • <type> is must be one of bugfix, feature, deprecation,breaking, doc, misc
    • if pr has no issue: consider creating one first or change it to the pr number after creating the pr
    • "sign" fragment with "by @"
    • please use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files - by @superuser."
    • also see examples
  • added yourself to CONTRIBUTORS (preserving alphabetical order)
Sometimes the output of tox in addition to the output of the command(s) tox is running can be a overwhelming and confusing. Allowing users to silence tox's output is incredibly useful in focusing on the command(s)'s output. Resolves tox-dev#256
@codecov
Copy link

codecov bot commented Nov 26, 2017

Codecov Report

Merging #682 into master will increase coverage by 3.82%.
The diff coverage is 94.11%.

Impacted file tree graph

@@ Coverage Diff @@ ## master #682 +/- ## ========================================= + Coverage 90.77% 94.6% +3.82%  ========================================= Files 11 11 Lines 2373 2426 +53 Branches 402 0 -402 ========================================= + Hits 2154 2295 +141  + Misses 144 131 -13  + Partials 75 0 -75
Impacted Files Coverage Δ
tox/config.py 97.64% <100%> (+2.56%) ⬆️
tox/session.py 94.83% <93.33%> (+2.83%) ⬆️
tox/__main__.py 0% <0%> (ø) ⬆️
tox/venv.py 96.26% <0%> (+2.49%) ⬆️
tox/_pytestplugin.py 94.92% <0%> (+4.96%) ⬆️
tox/_quickstart.py 82.75% <0%> (+5.13%) ⬆️
tox/_verlib.py 81.05% <0%> (+9.47%) ⬆️
tox/interpreters.py 92.85% <0%> (+15.51%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9cc8934...57a9201. Read the comment docs.

def error(self, msg):
self.logline("ERROR: " + msg, red=True)
if self.verbosity >= -1:
self.logline("ERROR: " + msg, red=True)
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if we should silence error messages...

Copy link
Author

Choose a reason for hiding this comment

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

So this would be if someone does tox -qq in other words, really really quiet tox. I think in that case it's fine. If someone does tox -q they still see ERROR messages. Make sense?

Copy link
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

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

I like the idea, however I think we should brush up a bit the implementation for better readability of the concept introduced here (for ease of maintenance).

@@ -0,0 +1 @@
Add a ``-q`` option to progressively silence tox's output. By @sigmavirus24
Copy link
Member

Choose a reason for hiding this comment

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

I feel like we needs some better description here, what does progressively exactly means? would prefer to detail what's the interaction between -v and -q; and for what amount what output the users is expected to get

config = newconfig(["-vv"], "")
assert config.option.verbosity == 2

def test_quiet(self, newconfig):
Copy link
Member

Choose a reason for hiding this comment

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

this should be a parametrized test

Copy link
Author

Choose a reason for hiding this comment

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

Ah, I see what you mean. I was basing it off the one above. Great catch.

tox/session.py Outdated
def verbosity(self):
if self.session:
return self.session.config.option.verbosity
return self.session.config.option.verbosity - self.session.config.option.quiet
Copy link
Member

Choose a reason for hiding this comment

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

First, here I would prefer we rename the verbosity of self.session.config.option.verbosity to something like verbose_level, to not conflict the property concept. Also rename quiet to quiet_level, this would make the two options similarly named, and clearly delimiting from the verbosity concept here.

tox/session.py Outdated

def error(self, msg):
self.logline("ERROR: " + msg, red=True)
if self.verbosity >= -1:
Copy link
Member

Choose a reason for hiding this comment

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

This minus one seems kinda arbitrary - at best should be a constant somewhere - however, even better, maybe the verbosity should be an enum instead, and compare it against that.

@gaborbernat gaborbernat added the needs:work for PRs: not quite there and needs some changes label Dec 1, 2017
Use a class to contain named constants to replace all the magic numbers used in the reporter. Further, rename the parsed values from the command-line.
@sigmavirus24
Copy link
Author

@gaborbernat I believe I've addressed your requested changes.

@gaborbernat gaborbernat merged commit 9f4cf09 into tox-dev:master Dec 10, 2017
@nedbat
Copy link
Contributor

nedbat commented Dec 10, 2017

@sigmavirus24 THANKS :)

@gaborbernat
Copy link
Member

Thanks for the contribution @sigmavirus24 👍

@sigmavirus24 sigmavirus24 deleted the add-quiet-option branch December 11, 2017 13:35
@sigmavirus24
Copy link
Author

@nedbat, you're welcome! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:work for PRs: not quite there and needs some changes

4 participants