From 46645d43ca9e4fbf13575dbdc257ee40d655c1b2 Mon Sep 17 00:00:00 2001 From: Dhaval Gojiya Date: Mon, 13 Oct 2025 14:25:52 +0530 Subject: [PATCH 1/3] [ci] - Add Ruff formatting step to CI pipeline --- .github/workflows/test.yml | 7 +++++++ scheduler/tests/test_task_types/test_task_model.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b5d3aa1..2847f9d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,12 +36,19 @@ jobs: - uses: actions/checkout@v5 with: persist-credentials: false + - name: Run Ruff Linting 🧹 uses: astral-sh/ruff-action@v3 with: args: check src: "." + - name: Run Ruff Formatting 🧽 + uses: astral-sh/ruff-action@v3 + with: + args: "format --check" + src: "." + test-regular: needs: ["ruff", "uv-lock-check"] runs-on: ubuntu-latest diff --git a/scheduler/tests/test_task_types/test_task_model.py b/scheduler/tests/test_task_types/test_task_model.py index fcab1ec..cf5bf25 100644 --- a/scheduler/tests/test_task_types/test_task_model.py +++ b/scheduler/tests/test_task_types/test_task_model.py @@ -231,7 +231,7 @@ def test_parse_kwargs(self): taskarg_factory(TaskKwarg, key="key3", arg_type="bool", val=True, content_object=task) taskarg_factory(TaskKwarg, key="key4", arg_type="datetime", val=date, content_object=task) kwargs = task.parse_kwargs() - self.assertEqual(kwargs, {'key1': "one", 'key2': 2, 'key3': True, 'key4': date}) + self.assertEqual(kwargs, {"key1": "one", "key2": 2, "key3": True, "key4": date}) def test_callable_args_and_kwargs(self): task = task_factory(self.task_type, callable="scheduler.tests.jobs.test_args_kwargs") @@ -418,7 +418,7 @@ def test_admin_single_delete(self): self.assertTrue(task.is_scheduled()) prev_executions_count = len(_get_executions(task)) url = reverse("admin:scheduler_task_delete", args=[task.pk]) - data = {'post': "yes"} + data = {"post": "yes"} # act res = self.client.post(url, data=data, follow=True) # assert From 6f94859e910bb5dd9b8ea475f61b562fec043520 Mon Sep 17 00:00:00 2001 From: Dhaval Gojiya Date: Mon, 13 Oct 2025 16:44:04 +0530 Subject: [PATCH 2/3] [refactor] - Simplify the Ruff format command in the CI pipeline --- .github/workflows/test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2847f9d..876e9d0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,10 +44,7 @@ jobs: src: "." - name: Run Ruff Formatting 🧽 - uses: astral-sh/ruff-action@v3 - with: - args: "format --check" - src: "." + run: ruff format --check . test-regular: needs: ["ruff", "uv-lock-check"] From 2017df05cb2b0e1d442ce65b3d1c97671f173fab Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 13 Oct 2025 13:42:52 +0200 Subject: [PATCH 3/3] Apply suggestion from @cclauss --- .github/workflows/test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 876e9d0..13c9355 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,9 +39,6 @@ jobs: - name: Run Ruff Linting 🧹 uses: astral-sh/ruff-action@v3 - with: - args: check - src: "." - name: Run Ruff Formatting 🧽 run: ruff format --check .