From 7b0b52c6e7370d9b3594f4c14ca266ba7ef5712b Mon Sep 17 00:00:00 2001 From: Bobbyperson Date: Tue, 27 Aug 2024 13:43:44 -0400 Subject: [PATCH] ci: Add ruff linter action (#54) Add ruff as a CI Python linter as the flake8 Action is slated for deprecation. --- .github/workflows/ruff.yml | 18 ++++++++++++++++++ .vscode/settings.json | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 .github/workflows/ruff.yml diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml new file mode 100644 index 0000000..4b6b575 --- /dev/null +++ b/.github/workflows/ruff.yml @@ -0,0 +1,18 @@ +name: Ruff linter +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ruff + - name: Run Ruff + run: ruff check --output-format=github --ignore=E402 . diff --git a/.vscode/settings.json b/.vscode/settings.json index 12a6af2..5f36dce 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,6 +5,9 @@ "flake8.args": [ "--ignore=E501,E402,W503" ], + "ruff.lint.args": [ + "--ignore=E402" + ], "[python]": { "editor.defaultFormatter": "ms-python.black-formatter", "editor.formatOnSave": true