Skip to content

Commit

Permalink
Switch linters CI to use pre-commit command line
Browse files Browse the repository at this point in the history
Using pre-commit-uv for fast installation
  • Loading branch information
spookylukey committed Jan 22, 2025
1 parent 6e0c5d6 commit 3b72c71
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 26 deletions.
22 changes: 4 additions & 18 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,17 @@ jobs:

linters:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} with uv
- name: Set up Python 3.10 with uv
uses: drivendataorg/[email protected]
with:
python-version: ${{ matrix.python-version }}
python-version: "3.10"
cache: 'packages'

- name: Install dependencies
run: |
uv sync
- name: Install linter deps
- name: Run pre-commit checks
run: |
uv pip install -r tests/requirements-linters.txt
- name: Run isort
run: |
uv run isort --version
uv run isort -c .
- name: Run flake8
if: failure() || success()
run: |
uv run flake8 --version
uv run flake8
- uses: psf/black@stable
with:
version: "22.3.0"
if: failure() || success()
uv run pre-commit run --all --all-files
15 changes: 7 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,36 @@ repos:
rev: 3.8.4
hooks:
- id: flake8
language_version: python3.9
language_version: python3.10
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.6.4
hooks:
- id: isort
language_version: python3.9
language_version: python3.10
- repo: https://github.com/ikamensh/flynt/
rev: '0.69'
hooks:
- id: flynt
language_version: python3.9
language_version: python3.10
- repo: https://github.com/asottile/pyupgrade
rev: v2.26.0
hooks:
- id: pyupgrade
entry: pyupgrade --py3-plus --py36-plus --py37-plus --keep-runtime-typing
language_version: python3.9
language_version: python3.10
- repo: https://github.com/myint/autoflake
rev: 'v1.4'
hooks:
- id: autoflake
args: ['--remove-all-unused-imports', '-i']
language_version: python3.9
language_version: python3.10
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: 'v1.5.7'
hooks:
- id: autopep8
language_version: python3.9
language_version: python3.10
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
language_version: python3
language_version: python3.9
language_version: python3.10
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ dev = [
"tox-uv>=1.20.1",
"tox>=4.24.1",
"pytest-cov>=6.0.0",
"pre-commit-uv>=4.1.4",
]

[tool.setuptools]
Expand Down

0 comments on commit 3b72c71

Please sign in to comment.