From 6159305a864b48f54f6d4d41eef3a837b84375b4 Mon Sep 17 00:00:00 2001 From: Dale Whinham Date: Thu, 31 Mar 2022 15:40:58 +0100 Subject: [PATCH] Add code linting for scripts to CI --- .flake8 | 3 +++ .github/workflows/ci.yml | 27 +++++++++++++++++++++++++++ .isort.cfg | 2 ++ 3 files changed, 32 insertions(+) create mode 100644 .flake8 create mode 100644 .isort.cfg diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..8dd399a --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +max-line-length = 88 +extend-ignore = E203 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 826728e..5fae3bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,8 +4,35 @@ on: [push, pull_request] env: toolchain-version: 10.3-2021.07 + python-version: 3.6 jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + with: + python-version: ${{ env.python-version }} + + - uses: psf/black@stable + with: + options: --check --diff --experimental-string-processing + src: scripts + + - uses: isort/isort-action@master + with: + sortPaths: scripts + + - uses: py-actions/flake8@v2 + with: + path: scripts + + - uses: ludeeus/action-shellcheck@master + with: + scandir: scripts + build: runs-on: ubuntu-latest name: build-${{ matrix.board }} diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..f238bf7 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,2 @@ +[settings] +profile = black