Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Use pre-commit reusable workflow #3

Merged
merged 1 commit into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 1 addition & 22 deletions .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,4 @@ jobs:
shell: bash

pre-commit:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3

- name: Install commitizen
run: pipx install poetry

- name: Set up python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'poetry'

- run: poetry install --with=dev

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

- run: poetry run pre-commit run --show-diff-on-failure --color=always --all-files
uses: janw/workflows/.github/workflows/poetry-pre-commit.yaml@main
24 changes: 0 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
ci:
autofix_prs: false
autoupdate_schedule: quarterly
autoupdate_commit_msg: 'build(pre-commit): [pre-commit.ci] pre-commit autoupdate'
skip: # see linters.yaml -> pre-commit job
- "rich-codex"
- "mypy"

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.11'
Expand All @@ -31,22 +23,6 @@ repos:

- repo: local
hooks:
- id: rich-codex
name: rich-codex
language: system
entry: >
env
FORCE_COLOR=1
TERMINAL_WIDTH=140
poetry run rich-codex
--skip-git-checks
--no-confirm
--terminal-theme MONOKAI
--created-files .assets/created.txt
pass_filenames: false
types: [markdown]
files: '(\.md|cli\.py|config\.py)$'

- id: mypy
name: mypy
entry: poetry run mypy
Expand Down
Loading