Skip to content

Commit 057e497

Browse files
authored
[red-knot] fix red-knot fuzzing (#16675)
The red-knot CLI changed since the fuzzer script was added; update it to work with current red-knot CLI. Also add some notes on how to ensure local changes to the fuzzer script are picked up.
1 parent 083df0c commit 057e497

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/py-fuzzer/fuzz.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
using a random selection of seeds, and only print a summary at the end
1818
(the `shuf` command is Unix-specific):
1919
`uvx --from ./python/py-fuzzer fuzz --bin ruff $(shuf -i 0-1000000 -n 10000) --quiet
20+
21+
If you make local modifications to this script, you'll need to run the above
22+
with `--reinstall` to get your changes reflected in the uv-cached installed
23+
package. Alternatively, if iterating quickly on changes, you can add
24+
`--with-editable ./python/py-fuzzer`.
2025
"""
2126

2227
from __future__ import annotations
@@ -48,7 +53,7 @@ def redknot_contains_bug(code: str, *, red_knot_executable: Path) -> bool:
4853
Path(tempdir, "pyproject.toml").write_text('[project]\n\tname = "fuzz-input"')
4954
Path(tempdir, "input.py").write_text(code)
5055
completed_process = subprocess.run(
51-
[red_knot_executable, "--current-directory", tempdir],
56+
[red_knot_executable, "check", "--project", tempdir],
5257
capture_output=True,
5358
text=True,
5459
)

0 commit comments

Comments
 (0)