★ wanayoo — archive 1999 https://github.com/pre-commit/pre-commit/pull/1560/commitsNouvelle recherche | Portail wanayoo
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

Implement quiet mode, silent on skipped hooks (WIP) #1560

Draft
wants to merge 9 commits into
base: master
from

Commits on Aug 22, 2020

  1. Add quiet to the namespace for type attribution

    Thank you to Anthony Sottile for guidance here.
    peterjc committed Aug 22, 2020
  2. Add --quiet to the hook-impl command.

    Can now add --quiet to the scripts like
    .git/hooks/pre-commit to run in quiet mode.
    peterjc committed Aug 22, 2020
  3. Hide passed lines in --quiet mode

    Downside is delay output on failed hooks
    peterjc committed Aug 22, 2020
  4. Success should not be silent in --quiet mode

    Adding a new summary line if all hooks passed
    or were skipped in either --quiet mode (where
    it may be the only output) or --verbose mode
    (since the summary seems worth showing here).
    peterjc committed Aug 22, 2020

Commits on Aug 24, 2020

  1. Revert "Hide passed lines in --quiet mode"

    This reverts commit 5c1a749.
    
    Feedback from Anthony Sottile was to focus on the skipped
    messages only for now.
    peterjc committed Aug 24, 2020
  2. Do not hide user-specified skipped hooks

    e.g.
    
    $ SKIP=mypy pre-commit run --files pre_commit/*.py
    Trim Trailing Whitespace.................................................Passed
    Fix End of Files.........................................................Passed
    Check docstring is first.................................................Passed
    Check JSON...........................................(no files to check)Skipped
    Check Yaml...........................................(no files to check)Skipped
    Debug Statements (Python)................................................Passed
    Tests should end in _test.py.........................(no files to check)Skipped
    Fix requirements.txt.................................(no files to check)Skipped
    Fix double quoted strings................................................Passed
    flake8...................................................................Passed
    autopep8.................................................................Passed
    Validate Pre-Commit Manifest.........................(no files to check)Skipped
    pyupgrade................................................................Passed
    Reorder python imports...................................................Passed
    Add trailing commas......................................................Passed
    setup-cfg-fmt........................................(no files to check)Skipped
    mypy....................................................................Skipped
    Check hooks apply to the repository..................(no files to check)Skipped
    Check for useless excludes...........................(no files to check)Skipped
    
    Versus:
    
    $ SKIP=mypy pre-commit run --files pre_commit/*.py -q
    Trim Trailing Whitespace.................................................Passed
    Fix End of Files.........................................................Passed
    Check docstring is first.................................................Passed
    Debug Statements (Python)................................................Passed
    Fix double quoted strings................................................Passed
    flake8...................................................................Passed
    autopep8.................................................................Passed
    pyupgrade................................................................Passed
    Reorder python imports...................................................Passed
    Add trailing commas......................................................Passed
    mypy....................................................................Skipped
    
    Here we still show mypy which the user had said to skip.
    peterjc committed Aug 24, 2020
  3. Add quiet mode to testing.util.run_opts

    Placed next to verbose due to logical connection.
    This is not part of a public API so the change
    should not matter - the tests all seem to pass
    arguments by name anyway.
    peterjc committed Aug 24, 2020
You can’t perform that action at this time.