From a47618f6e70920530d929516cc95e023162df1ca Mon Sep 17 00:00:00 2001 From: Smit Date: Thu, 8 Jun 2023 18:52:40 +0530 Subject: [PATCH 1/2] Fixed FileNotFound error while running hatch run lint-py --- pyproject.toml | 2 ++ tasks.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 55208a0ef..6274f18f1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,6 +104,8 @@ ignore = [ "S105", "S106", "S107", # Ignore complexity "C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915", + # Ignore escape sequence: `\ ` + "W605", ] unfixable = [ # Don't touch unused imports diff --git a/tasks.py b/tasks.py index a0cee5f9e..1fae54d7d 100644 --- a/tasks.py +++ b/tasks.py @@ -106,9 +106,10 @@ def lint_py(context: Context, fix: bool = False): else: context.run("ruff .") context.run("black --check --diff .") + path = str(ROOT).replace(" ", "\ ") + "/pyproject.toml" in_py( context, - f"flake8 --toml-config {ROOT / 'pyproject.toml'} .", + f"flake8 --toml-config {path} .", "hatch run lint:all", ) From 4d35a21c96e7e8c10bcc837d18d44325706cbfa4 Mon Sep 17 00:00:00 2001 From: Smit Date: Thu, 8 Jun 2023 21:39:00 +0530 Subject: [PATCH 2/2] Revert previous changes and add minor fix --- pyproject.toml | 2 -- tasks.py | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6274f18f1..55208a0ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,8 +104,6 @@ ignore = [ "S105", "S106", "S107", # Ignore complexity "C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915", - # Ignore escape sequence: `\ ` - "W605", ] unfixable = [ # Don't touch unused imports diff --git a/tasks.py b/tasks.py index 1fae54d7d..e19476202 100644 --- a/tasks.py +++ b/tasks.py @@ -106,10 +106,9 @@ def lint_py(context: Context, fix: bool = False): else: context.run("ruff .") context.run("black --check --diff .") - path = str(ROOT).replace(" ", "\ ") + "/pyproject.toml" in_py( context, - f"flake8 --toml-config {path} .", + f"flake8 --toml-config '{ROOT / 'pyproject.toml'}' .", "hatch run lint:all", )