From fd5b0824fff3812db85752c3892c7cce5203f7a1 Mon Sep 17 00:00:00 2001 From: skyflow-himanshu Date: Mon, 19 Jan 2026 17:53:58 +0530 Subject: [PATCH 1/3] SK-2482: add linter to python sdk v2 --- .github/workflows/shared-tests.yml | 3 +++ ruff.toml | 21 +++++++++++++++++++++ setup.py | 1 + skyflow/utils/validations/_validations.py | 4 ++++ 4 files changed, 29 insertions(+) create mode 100644 ruff.toml diff --git a/.github/workflows/shared-tests.yml b/.github/workflows/shared-tests.yml index 9ea5726..d9c0339 100644 --- a/.github/workflows/shared-tests.yml +++ b/.github/workflows/shared-tests.yml @@ -33,6 +33,9 @@ jobs: - name: Run Spell Check run: codespell + + - name: Run Linter Ruff + run: ruff check . - name: 'Run Tests' run: | diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..d0dd1af --- /dev/null +++ b/ruff.toml @@ -0,0 +1,21 @@ +# ruff.toml + +exclude = [ + "skyflow/generated", + ".git", + ".ruff_cache", + ".venv", + "venv", + "build", + "dist", + "tests" +] + +line-length = 120 + +[lint] +select = ["N"] + +ignore = [] + +[lint.pep8-naming] diff --git a/setup.py b/setup.py index b27bb0b..09f844d 100644 --- a/setup.py +++ b/setup.py @@ -36,6 +36,7 @@ extras_require={ 'dev': [ 'codespell', + 'ruff' ] }, python_requires=">=3.8", diff --git a/skyflow/utils/validations/_validations.py b/skyflow/utils/validations/_validations.py index 3da8b3a..95ea76f 100644 --- a/skyflow/utils/validations/_validations.py +++ b/skyflow/utils/validations/_validations.py @@ -819,3 +819,7 @@ def validate_get_detect_run_request(self, request: GetDetectRunRequest): if not request.run_id or not isinstance(request.run_id, str) or not request.run_id.strip(): raise SkyflowError(SkyflowMessages.Error.INVALID_RUN_ID.value, invalid_input_error_code) +# below function is only for testing ruff linter in github workflow +def badFunctionName(): + badVariableName = 123 + return badVariableName \ No newline at end of file From 2549342f3028db95a20662694096391756793196 Mon Sep 17 00:00:00 2001 From: skyflow-himanshu Date: Mon, 19 Jan 2026 18:13:46 +0530 Subject: [PATCH 2/3] SK-2482: fix linting issue for failing ci check --- skyflow/utils/validations/_validations.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/skyflow/utils/validations/_validations.py b/skyflow/utils/validations/_validations.py index 95ea76f..f3428f4 100644 --- a/skyflow/utils/validations/_validations.py +++ b/skyflow/utils/validations/_validations.py @@ -818,8 +818,3 @@ def validate_reidentify_text_request(self, request: ReidentifyTextRequest): def validate_get_detect_run_request(self, request: GetDetectRunRequest): if not request.run_id or not isinstance(request.run_id, str) or not request.run_id.strip(): raise SkyflowError(SkyflowMessages.Error.INVALID_RUN_ID.value, invalid_input_error_code) - -# below function is only for testing ruff linter in github workflow -def badFunctionName(): - badVariableName = 123 - return badVariableName \ No newline at end of file From 35dde062a35dd0245f704789cbcd123f609e85f9 Mon Sep 17 00:00:00 2001 From: skyflow-himanshu Date: Tue, 20 Jan 2026 12:58:50 +0530 Subject: [PATCH 3/3] SK-2482: addressed copilot comments --- .github/workflows/shared-tests.yml | 2 +- ruff.toml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/shared-tests.yml b/.github/workflows/shared-tests.yml index d9c0339..24fa6a0 100644 --- a/.github/workflows/shared-tests.yml +++ b/.github/workflows/shared-tests.yml @@ -35,7 +35,7 @@ jobs: run: codespell - name: Run Linter Ruff - run: ruff check . + run: ruff check . --output-format=github - name: 'Run Tests' run: | diff --git a/ruff.toml b/ruff.toml index d0dd1af..b679570 100644 --- a/ruff.toml +++ b/ruff.toml @@ -16,6 +16,4 @@ line-length = 120 [lint] select = ["N"] -ignore = [] - [lint.pep8-naming]