mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 10:31:46 +04:00
Add quiet mode to pre-commit run
This commit is contained in:
parent
0fd4a2ea38
commit
53670d6a7e
7 changed files with 268 additions and 29 deletions
|
|
@ -26,7 +26,6 @@ from pre_commit.logging_handler import logging_handler
|
|||
from pre_commit.store import Store
|
||||
from pre_commit.util import CalledProcessError
|
||||
|
||||
|
||||
logger = logging.getLogger('pre_commit')
|
||||
|
||||
# https://github.com/pre-commit/pre-commit/issues/217
|
||||
|
|
@ -35,7 +34,6 @@ logger = logging.getLogger('pre_commit')
|
|||
# pyvenv
|
||||
os.environ.pop('__PYVENV_LAUNCHER__', None)
|
||||
|
||||
|
||||
COMMANDS_NO_GIT = {'clean', 'gc', 'init-templatedir', 'sample-config'}
|
||||
|
||||
|
||||
|
|
@ -55,6 +53,13 @@ def _add_config_option(parser):
|
|||
)
|
||||
|
||||
|
||||
def _add_quiet_option(parser):
|
||||
parser.add_argument(
|
||||
'-q', '--quiet', action='store_true',
|
||||
help='Enable quiet mode',
|
||||
)
|
||||
|
||||
|
||||
class AppendReplaceDefault(argparse.Action):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(AppendReplaceDefault, self).__init__(*args, **kwargs)
|
||||
|
|
@ -242,6 +247,7 @@ def main(argv=None):
|
|||
_add_color_option(run_parser)
|
||||
_add_config_option(run_parser)
|
||||
_add_run_options(run_parser)
|
||||
_add_quiet_option(run_parser)
|
||||
|
||||
sample_config_parser = subparsers.add_parser(
|
||||
'sample-config', help='Produce a sample {} file'.format(C.CONFIG_FILE),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue