add merge group option #435
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: lint | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
merge_group: | |
branches: [ main ] | |
jobs: | |
linting: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
linter: ["flake8", "pylint", "pytype"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/[email protected] | |
with: | |
python-version: "3.11" | |
cache: 'pip' # caching pip dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install pytest ${{ matrix.linter }} | |
python -m pip install . | |
- | |
if: ${{ matrix.linter == 'flake8' }} | |
name: Lint with flake8 | |
run: | | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
flake8 . --count --max-complexity=10 --max-line-length=127 --statistics | |
- | |
if: ${{ matrix.linter == 'pylint' }} | |
name: Lint with pylint | |
run: | | |
pylint $(find particula/ -name "*.py" | xargs) | |
- | |
if: ${{ matrix.linter == 'pytype' }} | |
name: Lint with pytype | |
run: | | |
pytype -k . |