Skip to content

Commit

Permalink
InvalidLinkBear: Remove FTP from regex
Browse files Browse the repository at this point in the history
Remove 'ftp' from regex variable in `find_links_in_file()`
method because Python `requests` library can't fetch the FTP
status code.

Closes coala#906
  • Loading branch information
refeed committed Oct 28, 2016
1 parent 1e0469b commit 89e1108
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bears/general/InvalidLinkBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_status_code(url, timeout):
def find_links_in_file(file, timeout, link_ignore_regex):
link_ignore_regex = re.compile(link_ignore_regex)
regex = re.compile(
r'((ftp|http)s?://[^.:%\s_/?#[\]@\\]+\.(?:[^\s()%\'"`<>|\\]+|'
r'(https?://[^.:%\s_/?#[\]@\\]+\.(?:[^\s()%\'"`<>|\\]+|'
r'\([^\s()%\'"`<>|\\]*\))*)(?<!\.)(?<!,)')
for line_number, line in enumerate(file):
match = regex.search(line)
Expand Down

0 comments on commit 89e1108

Please sign in to comment.