Skip to content

Commit

Permalink
Run pre-commit in ci, add isort/flake8/pyupgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jieter committed Oct 17, 2023
1 parent 8d2dfad commit ebd6bd2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
21 changes: 2 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
name: CI
on: [push, pull_request]
jobs:
black:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/checkout@v4
- run: python -m pip install --upgrade black
- run: black --check .

flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/checkout@v4
- run: python -m pip install flake8
- run: flake8

isort:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/checkout@v4
- run: python -m pip install -r requirements/common.pip isort==5.6.4
- run: isort --diff --check django_tables2 test
- run: pre-commit run --show-diff-on-failure --all-files

tests:
runs-on: ubuntu-latest
Expand Down
23 changes: 20 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
repos:
- repo: https://github.com/psf/black
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
language_version: python3.11
- id: black
language_version: python3.11

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py38-plus]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8

0 comments on commit ebd6bd2

Please sign in to comment.