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

Add pre-commit config and autofix CI #12

Merged
merged 1 commit into from
Nov 6, 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
24 changes: 24 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Run pre-commit and autofix

on:
pull_request:
branches:
- main

jobs:
pre-commit:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
python-version: 3.12

- uses: pre-commit/action@v3.0.1

- uses: pre-commit-ci/lite-action@v1.1.0
if: always()
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,3 @@ target/

# pyenv
.python-version

17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/rstcheck/rstcheck
rev: v6.2.4
hooks:
- id: rstcheck
additional_dependencies: ["sphinx"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ All notable changes to this project will be documented in this file.

- Install 3.13 from deadsnakes

<!-- generated by git-cliff -->
<!-- generated by git-cliff -->
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ run-parallel = "pytest_run_parallel.plugin"

[dependency-groups]
dev = [
"pre-commit>=3.5.0",
"pytest-cov>=5.0.0",
"pytest-order>=1.3.0",
"ruff>=0.7.2",
"tox>=4.23.2",
]

[tool.ruff]
Expand Down Expand Up @@ -83,6 +85,6 @@ commands = [["ruff", "check"]]
"3.10" = ["py310"]
"3.11" = ["py311"]
"3.12" = ["py312"]
"3.13" = ["py313", "ruff"]
"3.13" = ["py313"]
"3.13t" = ["py313t"]
"pypy-3.8" = ["pypy3"]
210 changes: 210 additions & 0 deletions uv.lock

Large diffs are not rendered by default.