Merge pull request #141 from fishilico/check_fc_files-allow-arobas

testing/check_fc_files: allow @ character in file context patterns
This commit is contained in:
Chris PeBenito 2019-12-26 11:27:35 -05:00 committed by GitHub
commit 5d02fc45ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -152,7 +152,7 @@ def analyze_fc_file(fc_path):
reduced_path = reduced_path.replace("include`'(", 'include(') reduced_path = reduced_path.replace("include`'(", 'include(')
# Check the character set of the path # Check the character set of the path
invalid_characters = set(re.findall(r'[^-0-9A-Za-z_./()?+*%{}\[\]^|:~\\]', reduced_path)) invalid_characters = set(re.findall(r'[^-0-9A-Za-z_@./()?+*%{}\[\]^|:~\\]', reduced_path))
if invalid_characters: if invalid_characters:
print(f"{prefix}unexpected characters {' '.join(sorted(invalid_characters))} in {path}") print(f"{prefix}unexpected characters {' '.join(sorted(invalid_characters))} in {path}")
retval = False retval = False
@ -271,7 +271,7 @@ def analyze_fc_file(fc_path):
# Check the remaining symbols in the reduced path. # Check the remaining symbols in the reduced path.
# Only show a warning if no other ones were reported, in order to reduce the probability of false-positive. # Only show a warning if no other ones were reported, in order to reduce the probability of false-positive.
invalid_symbols = set(re.findall(r'[^-0-9A-Za-z_~:ᠰ/]', reduced_path)) invalid_symbols = set(re.findall(r'[^-0-9A-Za-z_@~:ᠰ/]', reduced_path))
if retval and invalid_symbols: if retval and invalid_symbols:
print(f"{prefix}unexpected symbols {' '.join(sorted(invalid_symbols))} in {path} after being reduced to {reduced_path}. This could be due to an error in the pattern or a missing reduction rule in the checker") # noqa print(f"{prefix}unexpected symbols {' '.join(sorted(invalid_symbols))} in {path} after being reduced to {reduced_path}. This could be due to an error in the pattern or a missing reduction rule in the checker") # noqa
retval = False retval = False