Skip to content

Commit

Permalink
build(pre-commit): Sync ruff version with poetry deps
Browse files Browse the repository at this point in the history
  • Loading branch information
janw committed Oct 3, 2024
1 parent 3b10858 commit e0d74c2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,40 @@ jobs:

mypy:
uses: janw/workflows/.github/workflows/poetry-mypy.yaml@main

pre-commit:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_PERSONAL_ACCESS_TOKEN }}

- name: Install poetry
run: pipx install poetry

- name: Set up python environment
uses: actions/setup-python@v5
with:
cache: poetry
python-version: 3.x

- name: Install dependencies
run: poetry install --no-root --sync

- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-v0|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
save-always: true

- run: poetry run pre-commit run --show-diff-on-failure --color=always --all-files
shell: bash

- uses: stefanzweifel/git-auto-commit-action@v5
if: always()
with:
commit_message: "build(lint): Auto-fix linting issues"
commit_user_name: "Jan Willhaus [bot]"
commit_user_email: "[email protected]"
commit_author: Jan Willhaus [bot] <[email protected]>
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ default_install_hook_types:
default_stages:
- pre-commit
repos:
- repo: https://github.com/janw/pre-commit-hooks
rev: v0.1.0
hooks:
- id: sync_ruff_version

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.6.8'
hooks:
Expand All @@ -31,6 +36,9 @@ repos:
- repo: https://github.com/python-poetry/poetry
rev: '1.8.0'
hooks:
- id: poetry-lock
args:
- --no-update
- id: poetry-check

- repo: https://github.com/streetsidesoftware/cspell-cli
Expand Down

0 comments on commit e0d74c2

Please sign in to comment.