From 9cae0bffffc82fa30475de93fa9d6fa5f6fd076e Mon Sep 17 00:00:00 2001 From: Joseph Frazier <1212jtraceur@gmail.com> Date: Mon, 31 Oct 2016 00:08:30 -0400 Subject: [PATCH] git_flag_after_filename: fix flake8 errors These were found by creating a `.flake8` file containing: [flake8] ignore = E501,W503 exclude = venv then running: flake8 $(git diff master... --name-only) See https://github.com/nvbn/thefuck/pull/563 for running `flake8` in CI --- tests/rules/test_git_flag_after_filename.py | 1 - thefuck/rules/git_flag_after_filename.py | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/rules/test_git_flag_after_filename.py b/tests/rules/test_git_flag_after_filename.py index ffb6e43c..414c0d95 100644 --- a/tests/rules/test_git_flag_after_filename.py +++ b/tests/rules/test_git_flag_after_filename.py @@ -1,4 +1,3 @@ -import pytest from thefuck.rules.git_flag_after_filename import match, get_new_command from tests.utils import Command diff --git a/thefuck/rules/git_flag_after_filename.py b/thefuck/rules/git_flag_after_filename.py index e2a94d8e..bec0591e 100644 --- a/thefuck/rules/git_flag_after_filename.py +++ b/thefuck/rules/git_flag_after_filename.py @@ -3,6 +3,7 @@ from thefuck.specific.git import git_support error_pattern = "fatal: bad flag '(.*?)' used after filename" + @git_support def match(command): return re.search(error_pattern, command.stderr) @@ -24,6 +25,6 @@ def get_new_command(command): # swap them command_parts[bad_flag_index], command_parts[filename_index] = \ - command_parts[filename_index], command_parts[bad_flag_index] + command_parts[filename_index], command_parts[bad_flag_index] # noqa: E122 return u' '.join(command_parts)