From c28aa5aebda953b55c9d282098f0e2c9c9778425 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Wed, 15 Nov 2023 14:37:02 +0100 Subject: [PATCH 1/5] Updated tests to reflect changes in file content handling --- test/utils/test_file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/utils/test_file.py b/test/utils/test_file.py index 30033362..0d544aa9 100644 --- a/test/utils/test_file.py +++ b/test/utils/test_file.py @@ -11,7 +11,7 @@ Line 2 Line 3 """ -FILE_2_CONTENT = """ +FILE_2_CONTENT = """ Line 2 Line 4 @@ -47,7 +47,7 @@ def setup_and_teardown_files(): [ ("file_1.txt", False, ["Line 1", "Line 2", "Line 3"], DoesNotRaise()), ("file_2.txt", True, ["Line 2", "Line 4"], DoesNotRaise()), - ("file_2.txt", False, ["", "Line 2", "", "Line 4", ""], DoesNotRaise()), + ("file_2.txt", False, [" ", "Line 2", "", "Line 4", ""], DoesNotRaise()), ("file_3.txt", True, ["Line 2", "Line 4"], DoesNotRaise()), ("file_3.txt", False, ["", "Line 2", "", "Line 4", ""], DoesNotRaise()), ("file_4.txt", True, None, pytest.raises(FileNotFoundError)), From fcfb57612fb9fdde140af842a7b1994277030834 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 13:37:50 +0000 Subject: [PATCH 2/5] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto=20?= =?UTF-8?q?format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/utils/test_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/test_file.py b/test/utils/test_file.py index 0d544aa9..681665c8 100644 --- a/test/utils/test_file.py +++ b/test/utils/test_file.py @@ -11,7 +11,7 @@ Line 2 Line 3 """ -FILE_2_CONTENT = """ +FILE_2_CONTENT = """ Line 2 Line 4 From d3fb4ad9321d1f316614bd668e3c277766e1d653 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Wed, 15 Nov 2023 14:41:38 +0100 Subject: [PATCH 3/5] Ignoring W291 for test_file.py --- pyproject.toml | 2 ++ test/utils/test_file.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f0c7ff4d..57a586ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,6 +82,7 @@ extend-ignore = """ per-file-ignores = """ __init__.py: F401 supervision/assets/list.py: E501 + test/utils/test_file.py: W291 """ [tool.isort] @@ -172,6 +173,7 @@ convention = "google" [tool.ruff.per-file-ignores] "__init__.py" = ["E402","F401"] "supervision/assets/list.py" = ["E501"] +"test/utils/test_file.py" = ["W291"] [tool.ruff.pylint] diff --git a/test/utils/test_file.py b/test/utils/test_file.py index 681665c8..0d544aa9 100644 --- a/test/utils/test_file.py +++ b/test/utils/test_file.py @@ -11,7 +11,7 @@ Line 2 Line 3 """ -FILE_2_CONTENT = """ +FILE_2_CONTENT = """ Line 2 Line 4 From 8025b468a277b508d8ae395df87597096c49d2ec Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 13:42:25 +0000 Subject: [PATCH 4/5] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto=20?= =?UTF-8?q?format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/utils/test_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/test_file.py b/test/utils/test_file.py index 0d544aa9..681665c8 100644 --- a/test/utils/test_file.py +++ b/test/utils/test_file.py @@ -11,7 +11,7 @@ Line 2 Line 3 """ -FILE_2_CONTENT = """ +FILE_2_CONTENT = """ Line 2 Line 4 From b9573605c735cb08b2fe538ef9dfee4d6cb47c4b Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Wed, 15 Nov 2023 17:01:57 +0300 Subject: [PATCH 5/5] =?UTF-8?q?fix(test):=20=F0=9F=A7=AA=20pre-commit's=20?= =?UTF-8?q?whitespace=20exclude=20and=20test=20case=20fix=20for=20whiespac?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Onuralp SEZER --- .pre-commit-config.yaml | 1 + pyproject.toml | 2 -- test/utils/test_file.py | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 28d135ae..4ae65d64 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,6 +11,7 @@ repos: hooks: - id: end-of-file-fixer - id: trailing-whitespace + exclude: test/.*\.py - id: check-yaml - id: check-docstring-first - id: check-executables-have-shebangs diff --git a/pyproject.toml b/pyproject.toml index 57a586ba..f0c7ff4d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,7 +82,6 @@ extend-ignore = """ per-file-ignores = """ __init__.py: F401 supervision/assets/list.py: E501 - test/utils/test_file.py: W291 """ [tool.isort] @@ -173,7 +172,6 @@ convention = "google" [tool.ruff.per-file-ignores] "__init__.py" = ["E402","F401"] "supervision/assets/list.py" = ["E501"] -"test/utils/test_file.py" = ["W291"] [tool.ruff.pylint] diff --git a/test/utils/test_file.py b/test/utils/test_file.py index 681665c8..7a8dd37f 100644 --- a/test/utils/test_file.py +++ b/test/utils/test_file.py @@ -11,12 +11,12 @@ Line 2 Line 3 """ -FILE_2_CONTENT = """ +FILE_2_CONTENT = """ Line 2 Line 4 -""" +""" # noqa FILE_3_CONTENT = """ Line 2