mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-08 04:34:16 +00:00
New hook 'destroyed-symlinks' to detect symlinks which are changed to regular files with a content of a path which that symlink was pointing to; move zsplit to util
This commit is contained in:
parent
14e9f0e512
commit
1e87d59a2d
9 changed files with 204 additions and 18 deletions
|
|
@ -8,18 +8,11 @@ from typing import Sequence
|
|||
from typing import Set
|
||||
|
||||
from pre_commit_hooks.util import cmd_output
|
||||
from pre_commit_hooks.util import zsplit
|
||||
|
||||
EXECUTABLE_VALUES = frozenset(('1', '3', '5', '7'))
|
||||
|
||||
|
||||
def zsplit(s: str) -> List[str]:
|
||||
s = s.strip('\0')
|
||||
if s:
|
||||
return s.split('\0')
|
||||
else:
|
||||
return []
|
||||
|
||||
|
||||
def check_executables(paths: List[str]) -> int:
|
||||
if sys.platform == 'win32': # pragma: win32 cover
|
||||
return _check_git_filemode(paths)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue