mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-22 04:48:57 +00:00
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
This commit is contained in:
parent
5b420204c9
commit
9cae0bffff
@ -1,4 +1,3 @@
|
|||||||
import pytest
|
|
||||||
from thefuck.rules.git_flag_after_filename import match, get_new_command
|
from thefuck.rules.git_flag_after_filename import match, get_new_command
|
||||||
from tests.utils import Command
|
from tests.utils import Command
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ from thefuck.specific.git import git_support
|
|||||||
|
|
||||||
error_pattern = "fatal: bad flag '(.*?)' used after filename"
|
error_pattern = "fatal: bad flag '(.*?)' used after filename"
|
||||||
|
|
||||||
|
|
||||||
@git_support
|
@git_support
|
||||||
def match(command):
|
def match(command):
|
||||||
return re.search(error_pattern, command.stderr)
|
return re.search(error_pattern, command.stderr)
|
||||||
@ -24,6 +25,6 @@ def get_new_command(command):
|
|||||||
|
|
||||||
# swap them
|
# swap them
|
||||||
command_parts[bad_flag_index], command_parts[filename_index] = \
|
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)
|
return u' '.join(command_parts)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user