Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Fix(tools): Disable debug msgs with linting

Kilian Lieret802af1753af2
diff --git a/tools/edit_anthropic/bin/str_replace_editor b/tools/edit_anthropic/bin/str_replace_editor
index 3e7f9ad5..32c10de1 100644
--- a/tools/edit_anthropic/bin/str_replace_editor
+++ b/tools/edit_anthropic/bin/str_replace_editor
@@ -142,10 +142,10 @@ def format_flake8_output(
Returns:
The filtered flake8 output as a string
"""
- print(f"Replacement window: {replacement_window}")
- print("Replacement n lines:", replacement_n_lines)
- print("Previous errors string:", previous_errors_string)
- print("Input string:", input_string)
+ # print(f"Replacement window: {replacement_window}")
+ # print("Replacement n lines:", replacement_n_lines)
+ # print("Previous errors string:", previous_errors_string)
+ # print("Input string:", input_string)
errors = [Flake8Error.from_line(line.strip()) for line in input_string.split("\n") if line.strip()]
# print(f"New errors before filtering: {errors=}")
lines = []
@@ -155,14 +155,14 @@ def format_flake8_output(
previous_errors = [
Flake8Error.from_line(line.strip()) for line in previous_errors_string.split("\n") if line.strip()
]
- print(f"Previous errors before updating: {previous_errors=}")
+ # print(f"Previous errors before updating: {previous_errors=}")
previous_errors = _update_previous_errors(previous_errors, replacement_window, replacement_n_lines)
- print(f"Previous errors after updating: {previous_errors=}")
+ # print(f"Previous errors after updating: {previous_errors=}")
errors = [error for error in errors if error not in previous_errors]
# Sometimes new errors appear above the replacement window that were 'shadowed' by the previous errors
# they still clearly aren't caused by the edit.
errors = [error for error in errors if error.line_number >= replacement_window[0]]
- print(f"New errors after filtering: {errors=}")
+ # print(f"New errors after filtering: {errors=}")
for error in errors:
if not show_line_numbers:
lines.append(f"- {error.problem}")