mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 19:46:54 +00:00
Added loaderon-hooks logic
This commit is contained in:
parent
0b70e285e3
commit
0a66e6635d
23 changed files with 612 additions and 0 deletions
11
pre_commit_hooks/loaderon-hooks/util/string_helpers.py
Normal file
11
pre_commit_hooks/loaderon-hooks/util/string_helpers.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import re
|
||||
|
||||
|
||||
def matches_any_regexp(string, regexp_list):
|
||||
"""Checks if string matches any of regexp in regexp_list."""
|
||||
for regexp in regexp_list:
|
||||
pattern = re.compile(regexp)
|
||||
if pattern.match(string):
|
||||
return True
|
||||
return False
|
||||
Loading…
Add table
Add a link
Reference in a new issue