From 8b59615ff7d521b1410a4e878229edc1e8c4f830 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 3 Apr 2023 04:45:13 +0200 Subject: [PATCH] GitHub Action to lint Python code (#1025) * GitHub Action to lint Python code [Ruff](https://beta.ruff.rs/) supports [over 500 lint rules](https://beta.ruff.rs/docs/rules) including bandit, isort, pylint, pyupgrade, and flake8 plus its plugins, and is written in Rust for speed. The `ruff` Action uses minimal steps to __run in ~5 seconds__, rapidly providing intuitive GitHub Annotations to contributors. ![image](https://user-images.githubusercontent.com/3709715/223758136-afc386d2-70aa-4eff-953a-2c2d82ceea23.png) * ruff --target-version=py39 --- .github/workflows/tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5fee7b457..aa73b4d92 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,6 +3,13 @@ name: Tests on: [push, pull_request] jobs: + ruff: # https://beta.ruff.rs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: pip install --user ruff + - run: ruff --format=github --line-length=7228 --target-version=py39 + --ignore=E402,E712,E721,E722,E741,F401,F403,F405,F541,F601,F811,F821,F822,F841 . build: runs-on: ${{ matrix.os }} if: "!contains(github.event.head_commit.message, '[skip ci]')"