Skip to content

Write resources handling #192

Write resources handling

Write resources handling #192

Workflow file for this run

name: Flake Linting
on: [push, pull_request, workflow_dispatch]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: false
- name: Set up Python 3.12
uses: actions/setup-python@v1
with:
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip3 install -r requirements.txt
- name: Lint with flake8
run: |
pip install flake8
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=src/deprecated,src/TtgcBot.py --ignore=E265,E266,E302,E305,E306,E501,E261,E262,E701,F401,E731,E704 --output-file=warnings.log
flake8 src/TtgcBot.py --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --ignore=E265,E266,E302,E305,E306,E501,E261,E262,E701,E402,E731,E704 --output-file=ttgcbot.log
flake8 . --count --select=F401 --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=src/deprecated,src/TtgcBot.py,*/__init__.py --output-file=F401.log
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude src/deprecated --output-file=errors.log
- name: Show report
if: ${{ always() }}
run: |
echo "Critical errors:"
if [ -r errors.log ]; then cat errors.log; fi
echo ""
echo "Warnings:"
if [ -r warnings.log ]; then cat warnings.log; fi
echo ""
if [ -r F401.log ]; then cat F401.log; fi
echo ""
if [ -r ttgcbot.log ]; then cat ttgcbot.log; fi
# - name: Upload report
# if: ${{ always() }}
# uses: actions/upload-artifact@v3
# with:
# path: report.log
# if-no-files-found: warn
# retention-days: 1
# - name: Test with pytest
# run: |
# pip install pytest
# pytest