mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 08:34:41 +04:00
Refactor pre_commit.repository and factor out cached-property
This commit is contained in:
parent
7448e588ff
commit
c577ed92e7
14 changed files with 390 additions and 446 deletions
10
pre_commit/meta_hooks/helpers.py
Normal file
10
pre_commit/meta_hooks/helpers.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import pipes
|
||||
import sys
|
||||
|
||||
|
||||
def make_meta_entry(modname):
|
||||
"""the hook `entry` is passed through `shlex.split()` by the command
|
||||
runner, so to prevent issues with spaces and backslashes (on Windows)
|
||||
it must be quoted here.
|
||||
"""
|
||||
return '{} -m {}'.format(pipes.quote(sys.executable), modname)
|
||||
Loading…
Add table
Add a link
Reference in a new issue