forked from luna/vim-rana-local
handle case where ignore patterns not defined
This commit is contained in:
parent
8244e3eb81
commit
01b77db70e
1 changed files with 10 additions and 9 deletions
|
@ -140,15 +140,16 @@ def parseArguments(argv):
|
||||||
|
|
||||||
|
|
||||||
def should_ignore(fileName, patterns):
|
def should_ignore(fileName, patterns):
|
||||||
if not patterns:
|
try:
|
||||||
patterns = []
|
for pattern in patterns:
|
||||||
for pattern in patterns:
|
try:
|
||||||
try:
|
compiled = re.compile(pattern, re.IGNORECASE)
|
||||||
compiled = re.compile(pattern, re.IGNORECASE)
|
if compiled.search(fileName):
|
||||||
if compiled.search(fileName):
|
return pattern
|
||||||
return pattern
|
except re.error as ex:
|
||||||
except re.error as ex:
|
log.warning('Regex error (%s) for ignore pattern: %s' % (str(ex), pattern))
|
||||||
log.warning('Regex error (%s) for ignore pattern: %s' % (str(ex), pattern))
|
except TypeError:
|
||||||
|
pass
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue