From 3e259892b10bc5254e5661491f33adf32958d94c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Schr=C3=B6dinger?= <132720404+Schrodinger71@users.noreply.github.com> Date: Sun, 29 Dec 2024 20:08:40 +0300 Subject: [PATCH] Fix Flake8 --- .flake8 | 2 + .github/workflows/flake8-linter.off | 61 ----------------------------- .github/workflows/flake8-linter.yml | 61 +++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 61 deletions(-) create mode 100644 .flake8 delete mode 100644 .github/workflows/flake8-linter.off create mode 100644 .github/workflows/flake8-linter.yml diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..031b3cb --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +ignore = F401 \ No newline at end of file diff --git a/.github/workflows/flake8-linter.off b/.github/workflows/flake8-linter.off deleted file mode 100644 index 58e8d0e..0000000 --- a/.github/workflows/flake8-linter.off +++ /dev/null @@ -1,61 +0,0 @@ -# name: Flake8 test - -# on: -# push: -# branches: -# - main -# - develop -# - dev -# pull_request: -# branches: -# - main -# - develop -# - dev - -# jobs: -# flake8: -# runs-on: ubuntu-latest - -# steps: -# - name: Checkout repository -# uses: actions/checkout@v3 - -# - name: Set up Python -# uses: actions/setup-python@v3 -# with: -# python-version: '3.11' - -# - name: Install MariaDB Connector/C -# run: | -# sudo apt-get update -# sudo apt-get install -y libmariadb-dev - -# - name: Cache Python dependencies -# uses: actions/cache@v3 -# with: -# path: ~/.cache/pip -# key: ${{ runner.os }}-pip-cache-${{ hashFiles('**/requirements.txt') }} -# restore-keys: | -# ${{ runner.os }}-pip-cache- - -# - name: Install dependencies -# run: | -# python -m pip install --upgrade pip -# pip install -r requirements.txt -# pip install asyncio logging aiohttp pyyaml - -# - name: Run Flake8 -# run: | -# pip install flake8 -# flake8 . - -# # - name: Upload Flake8 report -# # if: failure() -# # uses: actions/upload-artifact@v3 -# # with: -# # name: flake8-report -# # path: flake8-report.txt - -# - name: Summary -# run: | -# echo "Flake8 test completed. Check the results above." diff --git a/.github/workflows/flake8-linter.yml b/.github/workflows/flake8-linter.yml new file mode 100644 index 0000000..9732fd6 --- /dev/null +++ b/.github/workflows/flake8-linter.yml @@ -0,0 +1,61 @@ +name: Flake8 test + +on: + push: + branches: + - main + - develop + - dev + pull_request: + branches: + - main + - develop + - dev + +jobs: + flake8: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.11' + + - name: Install MariaDB Connector/C + run: | + sudo apt-get update + sudo apt-get install -y libmariadb-dev + + - name: Cache Python dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-cache-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip-cache- + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install asyncio logging aiohttp pyyaml + + - name: Run Flake8 + run: | + pip install flake8 + flake8 . + + # - name: Upload Flake8 report + # if: failure() + # uses: actions/upload-artifact@v3 + # with: + # name: flake8-report + # path: flake8-report.txt + + - name: Summary + run: | + echo "Flake8 test completed. Check the results above."