Skip to content

✨ project template #43

✨ project template

✨ project template #43

Workflow file for this run

name: Lint
on:
pull_request:
branches: ["**"]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Set up Github Workspace
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python Environment
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -q hatch pre-commit
hatch env create
hatch --version
- name: Lint
id: lint
continue-on-error: true
run: |
echo "::add-matcher::.github/workflows/matchers/flake8.json"
hatch run lint:style
echo "::remove-matcher owner=flake8::"
- name: Type Checking
id: mypy
continue-on-error: true
run: |
echo "::add-matcher::.github/workflows/matchers/mypy.json"
hatch run lint:typing
echo "::remove-matcher owner=mypy::"
- name: Raise Errors For Linting Failures
if: |
steps.lint.outcome != 'success' ||
steps.mypy.outcome != 'success'
run: |
echo "Lint: ${{ steps.flake8.outcome }}"
echo "MyPy: ${{ steps.mypy.outcome }}"
exit 1