mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-03-29 10:16:52 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
7abaf07fb5
commit
5008ecfb20
1 changed files with 4 additions and 3 deletions
|
|
@ -8,6 +8,7 @@ from typing import Sequence
|
|||
from pre_commit_hooks.util import CalledProcessError
|
||||
from pre_commit_hooks.util import cmd_output
|
||||
|
||||
|
||||
def has_naming_convention(
|
||||
patterns: AbstractSet[str] = frozenset(),
|
||||
) -> bool:
|
||||
|
|
@ -17,7 +18,7 @@ def has_naming_convention(
|
|||
return False
|
||||
chunks = ref_name.strip().split('/')
|
||||
branch_name = '/'.join(chunks[2:])
|
||||
|
||||
|
||||
return any(
|
||||
re.match(p, branch_name) for p in patterns
|
||||
)
|
||||
|
|
@ -39,9 +40,9 @@ def main(argv: Sequence[str] | None = None) -> int:
|
|||
args = parser.parse_args(argv)
|
||||
|
||||
patterns = frozenset(args.pattern or ())
|
||||
|
||||
|
||||
return int(has_naming_convention(patterns))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
raise SystemExit(main())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue