mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Add ability to pass filenames as arguments.
This commit is contained in:
parent
cfd86d5faa
commit
d8d7893cf7
3 changed files with 23 additions and 6 deletions
|
|
@ -43,13 +43,17 @@ def get_write_mock_output(write_mock):
|
|||
|
||||
def _get_opts(
|
||||
all_files=False,
|
||||
files=(),
|
||||
color=False,
|
||||
verbose=False,
|
||||
hook=None,
|
||||
no_stash=False,
|
||||
):
|
||||
# These are mutually exclusive
|
||||
assert not (all_files and files)
|
||||
return auto_namedtuple(
|
||||
all_files=all_files,
|
||||
files=files,
|
||||
color=color,
|
||||
verbose=verbose,
|
||||
hook=hook,
|
||||
|
|
@ -100,6 +104,12 @@ def test_run_all_hooks_failing(
|
|||
0,
|
||||
True,
|
||||
),
|
||||
(
|
||||
{'files': ('foo.py',), 'verbose': True},
|
||||
('foo.py'),
|
||||
0,
|
||||
True,
|
||||
),
|
||||
({}, ('Bash hook', '(no files to check)', 'Skipped'), 0, False),
|
||||
)
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue