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
9 changes: 7 additions & 2 deletions .github/workflows/prek.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: prek

on:
pull_request:
push:
branches: [main]
branches: [master]
pull_request:

jobs:
prek:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync
- uses: j178/prek-action@v1
with:
extra-args: --all-files
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.0
hooks:
- id: ruff-check
args: [--fix]
- id: ruff-format
- repo: local
hooks:
- id: ty
name: ty
entry: uv run ty check
language: system
types: [python]
- 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
8 changes: 3 additions & 5 deletions adopt_ruff/models/rule.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from __future__ import annotations

from enum import Enum
from typing import Any, Literal
from typing import Any

from pydantic import BaseModel
from pydantic import BaseModel, ConfigDict


class FixAvailability(Enum):
Expand All @@ -25,9 +25,7 @@ def one_word(self) -> str:


class Rule(BaseModel):
class Config:
frozen = True
use_enum_values: Literal[True]
model_config = ConfigDict(frozen=True, use_enum_values=True)

name: str
code: str
Expand Down
33 changes: 0 additions & 33 deletions prek.toml

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ build-backend = "hatchling.build"

[dependency-groups]
dev = [
"mypy>=1.14.0",
"ty",
"prek",
"ruff>=0.8.4",
]
Expand Down
Loading