From e8b99364b360586dc389670bed303590e69f1270 Mon Sep 17 00:00:00 2001 From: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:52:25 -0400 Subject: [PATCH] Use `ruff` for both linting and formatting in `langchain-cli`. (#12672) Prior to this PR, `ruff` was used only for linting and not for formatting, despite the names of the commands. This PR makes it be used for both linting code and autoformatting it. --- libs/cli/pyproject.toml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/cli/pyproject.toml b/libs/cli/pyproject.toml index ed3c8c2bbc8..9fc827408b5 100644 --- a/libs/cli/pyproject.toml +++ b/libs/cli/pyproject.toml @@ -44,9 +44,13 @@ select = [ [tool.poe.tasks] test = "poetry run pytest" watch = "poetry run ptw" -lint = "poetry run ruff ." -format = "poetry run ruff . --fix" +lint = ["_lint", "_check_formatting"] +format = ["_lint_fix", "_format"] +_check_formatting = "poetry run ruff format . --diff" +_lint = "poetry run ruff ." +_format = "poetry run ruff format ." +_lint_fix = "poetry run ruff . --fix" [build-system] requires = ["poetry-core"]