Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

Commit

Permalink
Fix flake8 errors
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <[email protected]>
  • Loading branch information
smorimoto committed Nov 15, 2020
1 parent b0bbcc9 commit 4f37026
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions codemod/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,11 @@ def _ask_about_patch(patch, editor, default_no):
if patch.new_lines is not None:
if not yes_to_all:
if default_no:
print('Accept change (y = yes, n = no [default], e = edit, ' +
'A = yes to all, E = yes+edit, q = quit)? '),
print('Accept change (y = yes, n = no [default], e = edit, '
+ 'A = yes to all, E = yes+edit, q = quit)? '),
else:
print('Accept change (y = yes [default], n = no, e = edit, ' +
'A = yes to all, E = yes+edit, q = quit)? '),
print('Accept change (y = yes [default], n = no, e = edit, '
+ 'A = yes to all, E = yes+edit, q = quit)? '),
p = _prompt('yneEAq', default=default_action)
else:
p = 'y'
Expand Down
6 changes: 3 additions & 3 deletions codemod/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ def the_filter(path):
return False
if exclude_paths:
for excluded in exclude_paths:
if (path.startswith(excluded) or
path.startswith('./' + excluded) or
fnmatch.fnmatch(path, excluded)):
if (path.startswith(excluded)
or path.startswith('./' + excluded)
or fnmatch.fnmatch(path, excluded)):
return False
return True
return the_filter
14 changes: 7 additions & 7 deletions codemod/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ def generate_patches(self):
path_list = Query._sublist(path_list, start_pos.path, end_pos.path)
path_list = (
path for path in path_list if
Query._path_looks_like_code(path) and
(self.path_filter(path)) or
(self.inc_extensionless and helpers.is_extensionless(path))
Query._path_looks_like_code(path)
and (self.path_filter(path))
or (self.inc_extensionless and helpers.is_extensionless(path))
)
for path in path_list:
try:
Expand Down Expand Up @@ -208,8 +208,8 @@ def _path_looks_like_code(path):
False
"""
return (
'/.' not in path and
path[-1] != '~' and
not path.endswith('tags') and
not path.endswith('TAGS')
'/.' not in path
and path[-1] != '~'
and not path.endswith('tags')
and not path.endswith('TAGS')
)
8 changes: 4 additions & 4 deletions codemod/terminal_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@


def _unicode(s, encoding='utf-8'):
if type(s) == bytes:
return s.decode(encoding, 'ignore')
else:
return str(s)
if type(s) == bytes:
return s.decode(encoding, 'ignore')
else:
return str(s)


def terminal_get_size(default_size=(25, 80)):
Expand Down

0 comments on commit 4f37026

Please sign in to comment.