Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ python -m unittest tests.python.test_values # single module
python -m unittest tests.python.test_oom_dedup tests.python.test_oom_dedup_wiring # OOM dedup

python test_doc.py # doctest-based tests over doc/*.rst and a few modules (not chmod +x)
ruff check fusil/ # lint — ruff is installed; pyflakes.sh needs pyflakes, which is not
# CI runs BOTH of these (ruff 0.15.18, pinned) over fusil/ tests/ fuzzers/fusil-python-threaded
# -- run both before pushing; `ruff check` passing does NOT imply `ruff format --check` passes.
ruff check fusil/ tests/ fuzzers/fusil-python-threaded # lint (pyflakes.sh needs pyflakes, not installed)
ruff format --check fusil/ tests/ fuzzers/fusil-python-threaded # format check; `ruff format <paths>` to fix

# Build/install. Packaging is defined entirely in pyproject.toml (setuptools
# backend; no setup.py). pip install pulls in python-ptrace; build isolation
Expand Down
17 changes: 10 additions & 7 deletions fusil/python/oom_dedup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ def _cap_lines(text):
if _STDOUT_LINE_CAP <= 0:
return text
return "\n".join(
ln if len(ln) <= _STDOUT_LINE_CAP else ln[:_STDOUT_LINE_CAP]
for ln in text.split("\n")
ln if len(ln) <= _STDOUT_LINE_CAP else ln[:_STDOUT_LINE_CAP] for ln in text.split("\n")
)


Expand Down Expand Up @@ -118,9 +117,7 @@ def classify(text):
return dict(
kind="segv", file=None, line=None, func=None, assert_expr=None, fatal_msg=None
)
return dict(
kind="fatal", file=None, line=None, func=None, assert_expr=None, fatal_msg=msg
)
return dict(kind="fatal", file=None, line=None, func=None, assert_expr=None, fatal_msg=msg)
if SEGV.search(text):
return dict(kind="segv", file=None, line=None, func=None, assert_expr=None, fatal_msg=None)
if IMPORTERR.search(text):
Expand Down Expand Up @@ -160,8 +157,14 @@ def load_snapshot(lines):
by_line.setdefault((f, int(ln)), set()).add(oid)
per_file_lines[f].append((int(ln), oid))
return dict(
func=by_func, assert_=by_assert, line=by_line, fl=per_file_lines, msg=by_msg,
msgfam=by_msgfam, kind=kind_of, funcname=by_funcname,
func=by_func,
assert_=by_assert,
line=by_line,
fl=per_file_lines,
msg=by_msg,
msgfam=by_msgfam,
kind=kind_of,
funcname=by_funcname,
)


Expand Down
Loading