Skip to content

Commit

Permalink
Comply to new flake8 3.6 (nvbn#853)
Browse files Browse the repository at this point in the history
* #N/A: Ignore W504 line break after binary operator

W504 is now part of flake8 current version 3.6

* #N/A: Fix invalid escape sequences

* #N/A: Remove conflicting path before installing gcc with brew
  • Loading branch information
scorphus authored and nvbn committed Oct 30, 2018
1 parent d226b8f commit e6be00a
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ addons:
- python-commandnotfound
- python3-commandnotfound
before_install:
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then rm /usr/local/include/c++ ; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew update ; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then brew upgrade python; fi
- if [[ $TRAVIS_OS_NAME == "osx" ]]; then pip3 install virtualenv; fi
Expand Down
4 changes: 2 additions & 2 deletions tests/rules/test_ag_literal.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def output():
'If you meant to search for a literal string, run ag with -Q\n')


@pytest.mark.parametrize('script', ['ag \('])
@pytest.mark.parametrize('script', ['ag \\('])
def test_match(script, output):
assert match(Command(script, output))

Expand All @@ -20,6 +20,6 @@ def test_not_match(script):


@pytest.mark.parametrize('script, new_cmd', [
('ag \(', 'ag -Q \(')])
('ag \\(', 'ag -Q \\(')])
def test_get_new_command(script, new_cmd, output):
assert get_new_command((Command(script, output))) == new_cmd
2 changes: 1 addition & 1 deletion thefuck/rules/aws_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from thefuck.utils import for_app, replace_argument

INVALID_CHOICE = "(?<=Invalid choice: ')(.*)(?=', maybe you meant:)"
OPTIONS = "^\s*\*\s(.*)"
OPTIONS = "^\\s*\\*\\s(.*)"


@for_app('aws')
Expand Down
2 changes: 1 addition & 1 deletion thefuck/rules/az_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from thefuck.utils import for_app, replace_argument

INVALID_CHOICE = "(?=az)(?:.*): '(.*)' is not in the '.*' command group."
OPTIONS = "^The most similar choice to '.*' is:\n\s*(.*)$"
OPTIONS = "^The most similar choice to '.*' is:\n\\s*(.*)$"


@for_app('az')
Expand Down
2 changes: 1 addition & 1 deletion thefuck/rules/heroku_multiple_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ def match(command):


def get_new_command(command):
apps = re.findall('([^ ]*) \([^)]*\)', command.output)
apps = re.findall('([^ ]*) \\([^)]*\\)', command.output)
return [command.script + ' --app ' + app for app in apps]
2 changes: 1 addition & 1 deletion thefuck/shells/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def split_command(self, command):
encoded = self.encode_utf8(command)

try:
splitted = [s.replace("??", "\ ") for s in shlex.split(encoded.replace('\ ', '??'))]
splitted = [s.replace("??", "\\ ") for s in shlex.split(encoded.replace('\\ ', '??'))]
except ValueError:
splitted = encoded.split(' ')

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ deps = -rrequirements.txt
commands = py.test -v --capture=sys

[flake8]
ignore = E501,W503
ignore = E501,W503,W504
exclude = venv,build,.tox,setup.py,fastentrypoints.py

0 comments on commit e6be00a

Please sign in to comment.