Skip to content

Commit

Permalink
Fix release link validations. (#4970)
Browse files Browse the repository at this point in the history
  • Loading branch information
surfnerd committed Feb 18, 2021
1 parent a1dee87 commit 07178a7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions utils/validate_release_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,16 @@ def check_file(
new_file_name = os.path.join(tempdir, os.path.basename(filename))
with open(new_file_name, "w+") as new_file:
# default to match everything if there is nothing in the ALLOW_LIST
allow_list_pattern = ALLOW_LIST.get(filename, MATCH_ANY)
allow_list_pattern = ALLOW_LIST.get(filename, None)
with open(filename) as f:
for line in f:
keep_line = True
keep_line = not RELEASE_PATTERN.search(line)
keep_line |= global_allow_pattern.search(line) is not None
keep_line |= allow_list_pattern.search(line) is not None
keep_line |= (
allow_list_pattern is not None
and allow_list_pattern.search(line) is not None
)

if keep_line:
new_file.write(line)
Expand Down

0 comments on commit 07178a7

Please sign in to comment.