Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (angr#1166)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.1.14 → v0.2.0](astral-sh/ruff-pre-commit@v0.1.14...v0.2.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply manual fixes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kevin Phoenix <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and twizmwazin authored Feb 5, 2024
1 parent 2b38f8e commit 1f37fb2
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ repos:
- id: rm-unneeded-f-str

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
rev: v0.2.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
3 changes: 1 addition & 2 deletions angrmanagement/data/breakpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ class Breakpoint:
def __init__(self, type_: BreakpointType, addr: int, size: int = 1, comment: str = ""):
self.type: BreakpointType = type_
self.addr: int = addr
self._size: int = 1
self.size = size
self._size = size
self.comment: str = comment

@property
Expand Down
2 changes: 1 addition & 1 deletion angrmanagement/logic/debugger/bintrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def get_called_functions(
num_nested_calls += 1

all_funcs = self.workspace.main_instance.project.kb.functions
return [((all_funcs[addr] if (addr in all_funcs) else addr), e) for (addr, e) in called_addrs]
return [((all_funcs.get(addr, addr)), e) for (addr, e) in called_addrs]

def get_called_functions_recursive(
self, event: Optional[TraceEvent] = None, max_depth: Optional[int] = None, depth: int = 0
Expand Down
4 changes: 1 addition & 3 deletions angrmanagement/plugins/trace_viewer/qtrace_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,12 @@ def _populate_trace_table(self, view, trace_ids):
numIDs = len(trace_ids)
view.clearContents()
view.setRowCount(numIDs)
row = 0 # start after label row
for traceID in trace_ids:
for row, traceID in enumerate(trace_ids):
inputID = self.multi_trace.am_obj.get_input_id_for_trace_id(traceID)
if inputID is None:
self.workspace.log("No inputID found for trace %s" % traceID)
view.setItem(row, 0, QTableWidgetItem(traceID))
view.setItem(row, 1, QTableWidgetItem(inputID))
row += 1

def _refresh_heatmap(self):
multiTrace = self.multi_trace.am_obj
Expand Down
4 changes: 2 additions & 2 deletions angrmanagement/ui/widgets/qxref_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _get_column_data(self, ref, idx):
self.TEXT_COL: self._text,
}

handler = mapping.get(idx, None)
handler = mapping.get(idx)
if handler is not None:
return handler(ref)
return None
Expand Down Expand Up @@ -207,7 +207,7 @@ def _get_column_data(self, ref, idx):
self.TEXT_COL: self._text,
}

handler = mapping.get(idx, None)
handler = mapping.get(idx)
if handler is not None:
return handler(ref)
return None
Expand Down
2 changes: 1 addition & 1 deletion angrmanagement/utils/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def to_supergraph(transition_graph):
edge = (node, dst)

if edge in edges_to_shrink:
dst_supernode = supernodes_map[dst] if dst in supernodes_map else None
dst_supernode = supernodes_map.get(dst)

src_supernode.insert_cfgnode(dst)

Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ target-version = ['py38']
[tool.ruff]
line-length = 120
target-version = 'py38'

[tool.ruff.lint]
select = [
"B",
"C4",
Expand Down

0 comments on commit 1f37fb2

Please sign in to comment.