Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: pre-commit
name: prek

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
prek:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tox-dev/action-pre-commit-uv@v1
- uses: j178/prek-action@v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ __pycache__
/result.md
/artifacts
.python-version
.worktrees/
23 changes: 0 additions & 23 deletions .pre-commit-config.yaml

This file was deleted.

9 changes: 5 additions & 4 deletions adopt_ruff/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys
from collections.abc import Iterable
from pathlib import Path
from typing import Annotated, Optional
from typing import Annotated

import more_itertools
import typer
Expand Down Expand Up @@ -53,7 +53,8 @@ def run_ruff(path: Path) -> tuple[set[Rule], tuple[Violation, ...], Version]:
for value in json.loads(
subprocess.run(
[
*["ruff" if ruff_version < Version("0.3.0") else "ruff", "check"],
"ruff",
"check",
str(path),
"--output-format=json",
"--select=ALL",
Expand Down Expand Up @@ -277,7 +278,7 @@ def _main(
),
] = Path(),
ruff_conf_path: Annotated[
Optional[Path], # noqa: UP007
Path | None,
typer.Option(
help="Path to the pyproject.toml/ruff.toml file. If not provided, adopt-ruff will attempt to locate it.",
envvar="ADOPT_RUFF_CONFIG_FILE_PATH",
Expand Down Expand Up @@ -306,7 +307,7 @@ def _main(
),
] = True,
repo_name: Annotated[
Optional[str], # noqa: UP007
str | None,
typer.Option(
help="The repository name for the report",
envvar="ADOPT_RUFF_REPO_NAME",
Expand Down
33 changes: 33 additions & 0 deletions prek.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[[repos]]
repo = "https://github.com/astral-sh/ruff-pre-commit"
rev = "v0.15.0"
hooks = [
{
id = "ruff-check",
args = ["--fix"]
},
{ id = "ruff-format" }
]

[[repos]]
repo = "https://github.com/pre-commit/mirrors-mypy"
rev = "v1.19.1"
hooks = [
{
id = "mypy",
additional_dependencies = ["types-tabulate"]
}
]

[[repos]]
repo = "https://github.com/pre-commit/pre-commit-hooks"
rev = "v6.0.0"
hooks = [
{ id = "trailing-whitespace" },
{ id = "end-of-file-fixer" },
{ id = "check-toml" },
{ id = "check-yaml" },
{ id = "check-json" },
{ id = "check-ast" },
{ id = "check-merge-conflict" }
]
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ build-backend = "hatchling.build"
[dependency-groups]
dev = [
"mypy>=1.14.0",
"pre-commit>=4.0.1",
"prek",
"ruff>=0.8.4",
]
typing = [
Expand Down Expand Up @@ -49,7 +49,6 @@ ignore = [
"G004",
"INP001",
"S501",
"PD901",
"E501",
"TD002",
"TD003",
Expand Down
368 changes: 137 additions & 231 deletions uv.lock

Large diffs are not rendered by default.