Skip to content

Commit

Permalink
build(pre-commit): Sync ruff version with poetry deps (#160)
Browse files Browse the repository at this point in the history
* build(pre-commit): Sync ruff version with poetry deps
* build(lint): Auto-fix linting issues
  • Loading branch information
janw authored Oct 3, 2024
1 parent 3b10858 commit 1ea2cfa
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 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
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ tqdm = "^4.66.4"
[tool.poetry.group.dev.dependencies]
ipython = "<8.18"
ipdb = "*"
ruff = ">=0.6.8"
ruff = "0.6.8"
pre-commit = "^3"
commitizen = "^3"
rich-codex = "^1"
Expand Down

0 comments on commit 1ea2cfa

Please sign in to comment.