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: Fix pre-commit linter #2

Merged
merged 1 commit into from
Jan 27, 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
18 changes: 5 additions & 13 deletions .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- run: cz check --rev-range origin/main..HEAD
shell: bash

pre-commit-extras:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Check out
Expand All @@ -38,17 +38,9 @@ jobs:

- run: poetry install --with=dev

- uses: pre-commit/[email protected]
- uses: actions/cache@v4
with:
extra_args: >
rich-codex
mypy
--all-files
path: ~/.cache/pre-commit
key: pre-commit-v0|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

- uses: actions/upload-artifact@v4
with:
name: assets
path: |
.assets/*
retention-days: 3
if: always()
- run: poetry run pre-commit run --show-diff-on-failure --color=always --all-files
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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-extras job
skip: # see linters.yaml -> pre-commit job
- "rich-codex"
- "mypy"

Expand Down
75 changes: 74 additions & 1 deletion poetry.lock

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

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ruff = "^0.1.14"
mypy = "^1.8.0"
rich-codex = "^1.2.7"
commitizen = "^3.13.0"
pre-commit = "^3.6.0"


[tool.poetry.group.tests.dependencies]
Expand Down
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import subprocess
from pathlib import Path
from shutil import rmtree
from typing import Iterator

import pytest

TESTING_TAP_NAME = "janw/poetry-homebrew-formula--testing"


@pytest.fixture(scope="session")
def homebrew_tapdir():
def homebrew_tapdir() -> Path:
_repo_path = (
subprocess.check_output(
(
Expand All @@ -24,7 +25,7 @@ def homebrew_tapdir():


@pytest.fixture()
def homebrew_fresh_tap(homebrew_tapdir: Path):
def homebrew_fresh_tap(homebrew_tapdir: Path) -> Iterator[Path]:
rmtree(homebrew_tapdir, ignore_errors=True)
(homebrew_tapdir / "Formula").mkdir(parents=True, exist_ok=True)
(homebrew_tapdir / "README.md").touch()
Expand Down
Loading