From a8f3261ab872e7a8c2e5cd890dbf1b44a1dc7e07 Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Tue, 24 Jun 2025 18:33:01 +1000 Subject: [PATCH] tools: Fix isort - Isort's has patches containing absolute paths that don't apply. - Let isort apply the patch itself. - The patch_command can either do the patch or return a patch. --- eris/__main__.py | 2 +- eris/tools.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eris/__main__.py b/eris/__main__.py index 21e7de7..8332567 100755 --- a/eris/__main__.py +++ b/eris/__main__.py @@ -794,7 +794,7 @@ class Screen: path_colored = lscolors.path_colored(path) self._log.log_message([in_green("Patching file: "), path_colored]) subprocess.run(f"{result.tool.patch_command} {path} | patch -p0", shell=True, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) + capture_output=True) subprocess.run(["touch", path]) def toggle_status_style(self): diff --git a/eris/tools.toml b/eris/tools.toml index 0f61767..546d7ed 100644 --- a/eris/tools.toml +++ b/eris/tools.toml @@ -103,7 +103,7 @@ tools_for_extensions = [ dependencies = ["python3-isort", "python3-colorama"] url = "https://pycqa.github.io/isort/" command = "/usr/bin/python3 -m isort --check-only --diff --color" - patch_command = "/usr/bin/python3 -m isort --diff" + patch_command = "/usr/bin/python3 -m isort --overwrite-in-place" has_color = true [perl_syntax]