Skip to content

Commit

Permalink
linter for typings branch
Browse files Browse the repository at this point in the history
  • Loading branch information
shahriyardx committed Oct 22, 2024
1 parent fc83215 commit 9d0f816
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/lint-test-typings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Lint & Test

on:
push:
branches:
- 'typings'
pull_request:
merge_group:
types: [checks_requested]

permissions:
read-all

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Run pre-commit
id: pre-commit
uses: pre-commit/[email protected]

pyright:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
experimental: [false]
fail-fast: false
continue-on-error: ${{ matrix.experimental }}

steps:
- uses: actions/checkout@v3


- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install .
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
flake8 ./easy_pil --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 ./easy_pil --count --exit-zero --max-complexity=10 --max-line-length=79 --statistics
- name: Test with pytest
run: |
pytest
- name: Run pyright (Linux)
uses: jakebailey/[email protected]
id: pyright-linux
with:
version: ${{ env.PYRIGHT_VERSION }}
python-version: ${{ steps.setup-env.outputs.python-version }}
python-platform: "Linux"
no-comments: ${{ matrix.python-version != '3.8' }} # only add comments for one version
warnings: true

- name: Run pyright (Windows)
uses: jakebailey/[email protected]
if: always() && (steps.pyright-linux.outcome == 'success' || steps.pyright-linux.outcome == 'failure')
with:
version: ${{ env.PYRIGHT_VERSION }}
python-version: ${{ steps.setup-env.outputs.python-version }}
python-platform: "Windows"
no-comments: true # only add comments for one platform (see above)
warnings: true

0 comments on commit 9d0f816

Please sign in to comment.