From 3d0a85467e51a18fc4a7cf2eb6e4992819f686d1 Mon Sep 17 00:00:00 2001 From: Saqib Bedar <124094939+saqibbedar@users.noreply.github.com> Date: Tue, 29 Sep 2026 22:47:22 +0500 Subject: [PATCH] ci: implement Ruff linter to safeguard .py and .ipynb files --- .github/workflows/lint.yml | 27 +++++++++++++++++++++++++++ .ruff.toml | 5 +++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/lint.yml create mode 100644 .ruff.toml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..03837e5 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,27 @@ +# CI Script for Code maintenance +name: Code Quality Check + +on: + pull_request: + branches: [ main ] + push: + branches: [ main ] + +jobs: + lint-and-format: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Set up uv & Python + uses: astral-sh/setup-uv@v5 + with: + python-version: "3.14" + enable-cache: true + + - name: Check Code Linting & Syntax Errors + run: uvx ruff check . + + - name: Verify Formatting Styles + run: uvx ruff format --check . \ No newline at end of file diff --git a/.ruff.toml b/.ruff.toml new file mode 100644 index 0000000..5d01075 --- /dev/null +++ b/.ruff.toml @@ -0,0 +1,5 @@ +target-version = "py314" +extend-include = ["*.ipynb"] + +[lint] +select = ["E", "F", "I"] \ No newline at end of file