From 2914e433503ec041d82db95a26f3bd8f47d94098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Mon, 18 Mar 2024 10:56:02 -0700 Subject: [PATCH] github: add linting workflow --- .github/workflows/lint.yaml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 000000000..e678623cb --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,32 @@ +name: lint + +on: + workflow_dispatch: + push: + branches: + - main + pull_request: + branches: + - "**" + paths-ignore: + - "docs/**" + +concurrency: + group: build-lint-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + autopep8: + name: "Formatting lints" + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: autopep8 + id: autopep8 + uses: peter-evans/autopep8@v2 + with: + args: --exit-code -r -d -a -a src/ + - name: Fail if autopep8 requires changes + if: steps.autopep8.outputs.exit-code == 2 + run: exit 1