diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f11eb74b..bcd3f522 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,29 +1,12 @@ name: CI on: [push, pull_request] jobs: - black: + pre-commit: runs-on: ubuntu-latest steps: - uses: actions/setup-python@v4.7.1 - uses: actions/checkout@v4 - - run: python -m pip install --upgrade black - - run: black --check . - - flake8: - runs-on: ubuntu-latest - steps: - - uses: actions/setup-python@v4.7.1 - - uses: actions/checkout@v4 - - run: python -m pip install flake8 - - run: flake8 - - isort: - runs-on: ubuntu-latest - steps: - - uses: actions/setup-python@v4.7.1 - - 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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c120986d..365f7777 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 +