Skip to content

Commit

Permalink
CI: Fix Pycodestyle Warning W605
Browse files Browse the repository at this point in the history
W605 is a warning for invalid escape sequences.

In python 3.6, Unknown escapes consisting of '\'
and an ASCII letter in regular expressions will
cause an warning.In the upcoming python versions
this would be treated as an error.
Owing to it pycodestyle have added this check for
future Python versions.

The alternative way to escape special characters
now is to append a extra `\` infront of the
sequences. Escape the characters by double backticks.

Fixes coala#2760
  • Loading branch information
Naveenaidu committed Feb 2, 2019
1 parent 4ea07ce commit 25a2c43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,17 +245,17 @@ def in_sum(stack): # pragma nt: no cover
def in_product(stack): # pragma nt: no cover
"""
A counting condition returning true if the variable is used in a product
statement, i.e. within the operators \*, /, % and their associated compound
operators.
statement, i.e. within the operators \\*, /, % and their associated
compound operators.
"""
return _stack_contains_operators(stack, ['*', '/', '%', '*=', '/=', '%='])


def in_binary_operation(stack): # pragma nt: no cover
"""
A counting condition returning true if the variable is used in a binary
operation, i.e. within the operators \|, & and their associated compound
operators.
operation, i.e. within the operators \\|, & and their associated
compound operators.
"""
return _stack_contains_operators(stack, ['&', '|', '&=', '|='])

Expand Down
2 changes: 1 addition & 1 deletion bears/vcs/git/GitCommitBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def check_github_pull_request_temporary_merge_commit(self):
"""
This function creates a git command to fetch the
unmerged parent commit shortlog from a commit generated
by GitHub in a refs/pull/(\d+)/merge git remote reference.
by GitHub in a refs/pull/(\\d+)/merge git remote reference.
Visit https://github.com/travis-ci/travis-ci/issues/8400
for more details.
Expand Down

0 comments on commit 25a2c43

Please sign in to comment.