File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 2525
2626# stdlib
2727import datetime
28+ import logging
2829import os
29- import sys
3030import textwrap
3131from typing import Iterable , Optional
3232
3838from domdf_python_tools .terminal_colours import Fore
3939from domdf_python_tools .typing import PathLike
4040from dulwich .errors import CommitError
41+ from pre_commit .commands import install_uninstall # type: ignore
4142from southwark import assert_clean
4243from southwark .repo import Repo
4344
4950 "run_repo_helper" ,
5051 ]
5152
53+ # Disable logging from pre-commit install command
54+ logging .getLogger (install_uninstall .__name__ ).addHandler (logging .NullHandler ())
55+ logging .getLogger (install_uninstall .__name__ ).propagate = False
56+ logging .getLogger (install_uninstall .__name__ ).addFilter (lambda record : False )
57+
5258
5359def commit_changed_files (
5460 repo_path : PathLike ,
@@ -92,7 +98,6 @@ def commit_changed_files(
9298 if enable_pre_commit :
9399 with in_directory (repo_path ):
94100 pre_commit .main .main (["install" ])
95- sys .stdout .flush ()
96101
97102 if staged_files :
98103 click .echo ("\n The following files will be committed:" )
Original file line number Diff line number Diff line change 1- pre-commit installed at .git/hooks/pre-commit
21
32The following files will be committed:
43 .dependabot/config.yml
@@ -41,5 +40,4 @@ The following files will be committed:
4140 tox.ini
4241
4342Committed as 6d8cf72fff6adc4e570cb046ca417db7f2e10a3b
44- pre-commit installed at .git/hooks/pre-commit
4543Nothing to commit
You can’t perform that action at this time.
0 commit comments