Some cleanup based on pyflakes output

This commit is contained in:
Michael Hohn
2022-03-17 17:23:53 -07:00
committed by =Michael Hohn
parent bdf85eafc8
commit db00f17137
8 changed files with 3 additions and 12 deletions

View File

@@ -38,7 +38,7 @@
python3 -m pip install -r requirements.txt
# Or separately:
pip install --upgrade pip
pip install ipython pyyaml pandas jupyter
pip install ipython pyyaml pandas jupyter pyflakes
#+END_SRC
"Install" for local development:

View File

@@ -1,6 +1,5 @@
#!/usr/bin/env python
import json
import sarif_cli.traverse as S
import sys
# TODO command-line: sarif-digest [<file>]

View File

@@ -9,7 +9,6 @@ from sarif_cli import typegraph
from dataclasses import dataclass
import sarif_cli.table_joins as tj
import sys
from collections import UserDict
import pandas as pd
#

View File

@@ -18,7 +18,6 @@ import pathlib
from sarif_cli import signature, signature_single
from sarif_cli import typegraph
import sys
from collections import defaultdict
import pandas as pd
#

View File

@@ -1,7 +1,6 @@
#!/usr/bin/env python
import argparse
import json
import sarif_cli.traverse as S
import sys
import collections

View File

@@ -3,7 +3,6 @@ import argparse
import json
import sarif_cli.traverse as S
import sys
import collections
parser = argparse.ArgumentParser(description='list source files referenced by sarif file')
parser.add_argument('file', metavar='sarif-file', type=str,

View File

@@ -2,9 +2,7 @@
import argparse
import json
import sarif_cli.traverse as S
import re
import sys
import collections
parser = argparse.ArgumentParser(description='summary of results')
parser.add_argument('file', metavar='sarif-file', type=str, help='input file, - for stdin')

View File

@@ -8,7 +8,7 @@ This file also contains some type graph reference values; these may be moved out
separate files at some point.
"""
from dataclasses import dataclass
from typing import *
from typing import Any, Dict, List, Tuple, Union
import pandas as pd
#
@@ -230,7 +230,7 @@ def _destructure_list(typegraph, node: str, tree: List):
id(value)))
# Next `value` on success
break
except MissingFieldException as e:
except MissingFieldException:
# Re-raise if last available signature failed, otherwise try
# next `signature`
if (sigindex, sigtype) == signature[-1]:
@@ -265,14 +265,12 @@ def tagged_array_columns(typegraph, array_id):
t8754_array_id t8754_value_index t8754_type_at_index t8754_id_or_value_at_index
"""
array_id = str(array_id)
typedef = 'Array' + array_id
colheader = ('array_id', 'value_index', 'type_at_index', 'id_or_value_at_index')
return { header:"t{:s}_{:s}".format(array_id, header) for header in colheader}
def tagged_struct_columns(typegraph, struct_id):
""" Return a dict mapping the struct column names to versions tagged with the id.
XX:
"""
struct_id = str(struct_id)
typedef = 'Struct' + struct_id