Skip to content

Commit 9407c9b

Browse files
committed
Use pre-commit-mirror-maker instead rolling our own
Signed-off-by: Bernát Gábor <[email protected]>
1 parent 399510c commit 9407c9b

File tree

10 files changed

+53
-414
lines changed

10 files changed

+53
-414
lines changed

.github/workflows/check.yaml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Mirror
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
schedule:
7+
- cron: "30 8 * * *"
8+
9+
jobs:
10+
build:
11+
name: Mirror
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- run: git config --global user.name 'Github Actions'
16+
- run: git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
17+
- name: Install the latest version of uv
18+
uses: astral-sh/setup-uv@v3
19+
with:
20+
version: "latest"
21+
- run: >-
22+
uvx -p 3.13 --from pre-commit-mirror-maker pre-commit-mirror . \
23+
--language=python --package-name=pyproject-fmt --files-regex '(^|/)pyproject\.toml$'
24+
- run: |
25+
git remote set-url origin https://x-access-token:[email protected]/$GITHUB_REPOSITORY
26+
git push origin HEAD:refs/heads/main --tags
27+
if: ${{ github.ref == 'refs/heads/main' }}
28+
env:
29+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/mirror.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@ repos:
1414
hooks:
1515
- id: codespell
1616
additional_dependencies: ["tomli>=2.0.1"]
17-
- repo: https://github.com/tox-dev/pyproject-fmt
18-
rev: "2.4.3"
19-
hooks:
20-
- id: pyproject-fmt
21-
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: "v0.7.0"
23-
hooks:
24-
- id: ruff-format
25-
args: ["--config", "pyproject.toml"]
26-
- id: ruff
27-
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix", "--config", "pyproject.toml"]
2817
- repo: https://github.com/rbubley/mirrors-prettier
2918
rev: "v3.3.3"
3019
hooks:

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
# pyproject-fmt mirror
22

3-
[![Mirror](https://github.com/tox-dev/pyproject-fmt/actions/workflows/mirror.yaml/badge.svg)](https://github.com/tox-dev/pyproject-fmt/actions/workflows/mirror.yaml)
4-
[![Test](https://github.com/tox-dev/pyproject-fmt/actions/workflows/check.yaml/badge.svg)](https://github.com/tox-dev/pyproject-fmt/actions/workflows/check.yaml)
3+
[![Main](https://github.com/tox-dev/pyproject-fmt/actions/workflows/main.yaml/badge.svg)](https://github.com/tox-dev/pyproject-fmt/actions/workflows/main.yaml)
54

6-
The source code for this project now lives inside
7-
[toml-fmt](https://github.com/tox-dev/toml-fmt/tree/main/pyproject-fmt), this repository serves only as a mirror for
8-
pre-commit.
5+
Mirror of [`pyproject-fmt`](https://github.com/tox-dev/toml-fmt/tree/main/pyproject-fmt) for
6+
[pre-commit](https://github.com/pre-commit/pre-commit).
7+
8+
### Using `pyproject-fmt` with pre-commit
9+
10+
Add it to your `.pre-commit-config.yaml`:
11+
12+
```yaml
13+
- repo: https://github.com/pre-commit/pyproject-fmt
14+
rev: "" # Use the sha / tag you want to point at
15+
hooks:
16+
- id: pyproject-fmt
17+
```

pyproject.toml

Lines changed: 0 additions & 143 deletions
This file was deleted.

setup.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from __future__ import annotations
2+
3+
from setuptools import setup
4+
5+
6+
setup(
7+
name="pre_commit_placeholder_package",
8+
version="0.0.0",
9+
install_requires=["pyproject-fmt==2.4.3"],
10+
)

tasks/mirror.py

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)