1
0
forked from VimPlug/jedi

Get rid of a lot of flake8 errors

This commit is contained in:
Dave Halter
2020-01-01 02:37:48 +01:00
parent 818577f423
commit 66ad620692
12 changed files with 47 additions and 47 deletions

View File

@@ -146,8 +146,8 @@ def extract(script, new_name):
# add parentheses in multi-line case
open_brackets = ['(', '[', '{']
close_brackets = [')', ']', '}']
if '\n' in text and not (text[0] in open_brackets and text[-1] ==
close_brackets[open_brackets.index(text[0])]):
if '\n' in text and not (text[0] in open_brackets and text[-1]
== close_brackets[open_brackets.index(text[0])]):
text = '(%s)' % text
# add new line before statement
@@ -183,7 +183,7 @@ def inline(script):
replace_str = line[expression_list[0].start_pos[1]:stmt.end_pos[1] + 1]
replace_str = replace_str.strip()
# tuples need parentheses
if expression_list and isinstance(expression_list[0], pr.Array):
if expression_list and expression_list[0].type == 'TODO':
arr = expression_list[0]
if replace_str[0] not in ['(', '[', '{'] and len(arr) > 1:
replace_str = '(%s)' % replace_str