flake8 to ignore some errors and small style improvements

This commit is contained in:
Julian Hammer
2021-03-11 12:52:34 +01:00
parent b7625a4a25
commit 63563ecabc
4 changed files with 8 additions and 6 deletions

View File

@@ -774,7 +774,8 @@ def get_description(arch, rhs_comment=None):
commented_description = ""
for line in descriptions[arch].split("\n"):
commented_description += ("{:<" + str(max_length) + "} # {}\n").format(
line, rhs_comment)
line, rhs_comment
)
description = commented_description
return description

View File

@@ -48,7 +48,7 @@ class KernelDG(nx.DiGraph):
instruction_form["line_number"],
latency=instruction_form["latency"] - instruction_form["latency_wo_load"],
)
for dep in self.find_depending(instruction_form, kernel[i + 1:]):
for dep in self.find_depending(instruction_form, kernel[i + 1 :]):
edge_weight = (
instruction_form["latency"]
if "latency_wo_load" not in instruction_form

View File

@@ -184,7 +184,7 @@ def match_bytes(lines, index, byte_list):
line_count += 1
extracted_bytes += lines[index].directive.parameters
index += 1
if extracted_bytes[0:len(byte_list)] == byte_list:
if extracted_bytes[0 : len(byte_list)] == byte_list:
return True, line_count
return False, -1
@@ -219,7 +219,7 @@ def find_jump_labels(lines):
if all(
[
line["instruction"].startswith(".")
for line in lines[labels[label][0]:labels[label][1]]
for line in lines[labels[label][0] : labels[label][1]]
if line["instruction"] is not None
]
):
@@ -243,7 +243,7 @@ def find_basic_blocks(lines):
blocks = OrderedDict()
for label, label_line_idx in valid_jump_labels.items():
blocks[label] = [lines[label_line_idx]]
for line in lines[label_line_idx + 1:]:
for line in lines[label_line_idx + 1 :]:
terminate = False
blocks[label].append(line)
# Find end of block by searching for references to valid jump labels
@@ -272,7 +272,7 @@ def find_basic_loop_bodies(lines):
loop_bodies = OrderedDict()
for label, label_line_idx in valid_jump_labels.items():
current_block = [lines[label_line_idx]]
for line in lines[label_line_idx + 1:]:
for line in lines[label_line_idx + 1 :]:
terminate = False
current_block.append(line)
# Find end of block by searching for references to valid jump labels

View File

@@ -3,6 +3,7 @@
max-line-length=100
[flake8]
max-line-length=100
ignore=E203,W503
[metadata]
license-file=LICENSE