From ce39bc81c1e08ed5ee98b57b2869026ad87f524a Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 13 Mar 2023 16:14:46 +0100 Subject: [PATCH 1/3] misc: Create 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 ~10 seconds, rapidly providing intuitive GitHub Annotations to contributors. ![image](https://user-images.githubusercontent.com/3709715/223758136-afc386d2-70aa-4eff-953a-2c2d82ceea23.png) --- .github/workflows/lint_python.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/lint_python.yml diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml new file mode 100644 index 00000000..eb7ba6c3 --- /dev/null +++ b/.github/workflows/lint_python.yml @@ -0,0 +1,16 @@ +# https://beta.ruff.rs +name: ruff +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: pip install --user ruff + - run: ruff --format=github --ignore="E722,F40,F841" --line-length=110 --target-version=py37 . From 39701b123b868e06e82ad8176f73fae802c401f6 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 13 Mar 2023 16:16:18 +0100 Subject: [PATCH 2/3] line-length = 681 --- .github/workflows/lint_python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml index eb7ba6c3..d14e8443 100644 --- a/.github/workflows/lint_python.yml +++ b/.github/workflows/lint_python.yml @@ -13,4 +13,4 @@ jobs: steps: - uses: actions/checkout@v3 - run: pip install --user ruff - - run: ruff --format=github --ignore="E722,F40,F841" --line-length=110 --target-version=py37 . + - run: ruff --format=github --ignore="E722,F40,F841" --line-length=681 --target-version=py37 . From 00453c7c9c1f3e3af8649d920bd60a5b44885c63 Mon Sep 17 00:00:00 2001 From: childish-sambino Date: Mon, 13 Mar 2023 11:09:13 -0500 Subject: [PATCH 3/3] Update and rename lint_python.yml to lint-python.yml --- .github/workflows/lint-python.yml | 16 ++++++++++++++++ .github/workflows/lint_python.yml | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/lint-python.yml delete mode 100644 .github/workflows/lint_python.yml diff --git a/.github/workflows/lint-python.yml b/.github/workflows/lint-python.yml new file mode 100644 index 00000000..1c5f53f2 --- /dev/null +++ b/.github/workflows/lint-python.yml @@ -0,0 +1,16 @@ +# https://beta.ruff.rs +name: ruff +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: pip install --user ruff + - run: ruff --format=github --ignore="E722,F40,F841" --line-length=681 --target-version=py37 . diff --git a/.github/workflows/lint_python.yml b/.github/workflows/lint_python.yml deleted file mode 100644 index d14e8443..00000000 --- a/.github/workflows/lint_python.yml +++ /dev/null @@ -1,16 +0,0 @@ -# https://beta.ruff.rs -name: ruff -on: - push: - branches: - - main - pull_request: - branches: - - main -jobs: - ruff: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - run: pip install --user ruff - - run: ruff --format=github --ignore="E722,F40,F841" --line-length=681 --target-version=py37 .