From 6758885886a7b60ad67ae7ff95578bfbbc43088e Mon Sep 17 00:00:00 2001 From: stolik1984 <95292560+stolik1984@users.noreply.github.com> Date: Fri, 19 Jan 2024 15:43:32 +0300 Subject: [PATCH] Create python-flake8.yml (#3) --- .github/workflows/python-flake8.yml | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/python-flake8.yml diff --git a/.github/workflows/python-flake8.yml b/.github/workflows/python-flake8.yml new file mode 100644 index 0000000..0335d02 --- /dev/null +++ b/.github/workflows/python-flake8.yml @@ -0,0 +1,35 @@ +name: Python flake8 + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.10, 3.11, 3.12] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest-custom_exit_code + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + # flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # stop the build if there are any errors except listed + flake8 . --count --select=E,F,W --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-line-length=80 --statistics