mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
Implement no-dependency system and script hook types. Closes #39.
This commit is contained in:
parent
02660f7c0a
commit
c418f2b94e
14 changed files with 86 additions and 52 deletions
13
pre_commit/languages/system.py
Normal file
13
pre_commit/languages/system.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
def install_environment(repo_cmd_runner):
|
||||
"""Installation for system type is a noop."""
|
||||
pass
|
||||
|
||||
|
||||
def run_hook(repo_cmd_runner, hook, file_args):
|
||||
return repo_cmd_runner.run(
|
||||
['xargs', hook['entry']] + hook.get('args', []),
|
||||
# TODO: this is duplicated in pre_commit/languages/helpers.py
|
||||
stdin='\n'.join(list(file_args) + ['']),
|
||||
retcode=None,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue