From ec3285ed5a1d9135b1cf80bad4d190de6058af68 Mon Sep 17 00:00:00 2001 From: Arash Date: Mon, 19 Jan 2026 17:34:36 +0100 Subject: [PATCH 1/4] add linting workflow using ruff for pull requests --- .github/workflows/lint.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..b6391bb --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,14 @@ +name: Lint + +on: + pull_request: + branches: [main] + +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: astral-sh/ruff-action@v3 + with: + args: check --select E,F,W --ignore E501 From 646e544d05ba63cc8b5297f34316eff6f815a7fc Mon Sep 17 00:00:00 2001 From: Arash Date: Thu, 19 Feb 2026 17:52:16 +0100 Subject: [PATCH 2/4] update lint workflow to include separate steps for Ruff linter and formatter --- .github/workflows/lint.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b6391bb..a34afd5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,14 +1,23 @@ -name: Lint +name: Lint and Format on: + push: + branches: [main] pull_request: branches: [main] jobs: - ruff: + check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - uses: astral-sh/ruff-action@v3 + + - name: Run Ruff Linter + uses: astral-sh/ruff-action@v3 + with: + args: "check --select E,F,W --ignore E501" + + - name: Run Ruff Formatter + uses: astral-sh/ruff-action@v3 with: - args: check --select E,F,W --ignore E501 + args: "format --check" From 6626d4e79abf8d2be2cc1c88517914e50b1c816e Mon Sep 17 00:00:00 2001 From: Arash Date: Fri, 20 Feb 2026 11:26:07 +0100 Subject: [PATCH 3/4] refactor lint workflow to simplify Ruff linter arguments --- .github/workflows/lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a34afd5..a01d8a3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,9 +15,10 @@ jobs: - name: Run Ruff Linter uses: astral-sh/ruff-action@v3 with: - args: "check --select E,F,W --ignore E501" + args: "check" - name: Run Ruff Formatter + if: always() uses: astral-sh/ruff-action@v3 with: args: "format --check" From 1a8e0668eacecbf955303c04fe3f48859a15431c Mon Sep 17 00:00:00 2001 From: Arash Date: Tue, 24 Feb 2026 11:23:40 +0100 Subject: [PATCH 4/4] add Makefile for Ruff linting setup and commands --- Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..48ffa41 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +RUFF := $(shell command -v ruff 2>/dev/null || echo ~/.local/bin/ruff) + +.PHONY: fix check setup + +setup: + @command -v ruff >/dev/null 2>&1 || (echo "Installing Ruff..." && curl -LsSf https://astral.sh/ruff/install.sh | sh) + +fix: setup + $(RUFF) check --fix . + $(RUFF) format . + +check: setup + $(RUFF) check . + $(RUFF) format --check .