mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-03 18:56:54 +00:00
Disallow any branch name in checks_vcs_permalinks
This commit is contained in:
parent
4195f4d271
commit
4729918bc9
2 changed files with 9 additions and 2 deletions
|
|
@ -8,7 +8,10 @@ from typing import Sequence
|
|||
|
||||
|
||||
def _get_pattern(domain: str) -> Pattern[bytes]:
|
||||
regex = rf'https://{domain}/[^/ ]+/[^/ ]+/blob/master/[^# ]+#L\d+'
|
||||
regex = (
|
||||
rf'https://{domain}/[^/ ]+/[^/ ]+/blob/'
|
||||
r'(?![a-fA-F0-9]{4,64}/)([^/. ]+)/[^# ]+#L\d+'
|
||||
)
|
||||
return re.compile(regex.encode())
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue