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

Use pre-commit-mirror-maker instead rolling our own #276

Merged
merged 1 commit into from
Oct 24, 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
48 changes: 0 additions & 48 deletions .github/workflows/check.yaml

This file was deleted.

29 changes: 29 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Mirror
on:
push:
branches: [main]
pull_request:
schedule:
- cron: "30 8 * * *"

jobs:
build:
name: Mirror
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: git config --global user.name 'Github Actions'
- run: git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- run: >-
uvx -p 3.13 --from pre-commit-mirror-maker pre-commit-mirror . \
--language=python --package-name=pyproject-fmt --files-regex '(^|/)pyproject\.toml$'
- run: |
git remote set-url origin https://x-access-token:[email protected]/$GITHUB_REPOSITORY
git push origin HEAD:refs/heads/main --tags
if: ${{ github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32 changes: 0 additions & 32 deletions .github/workflows/mirror.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,6 @@ repos:
hooks:
- id: codespell
additional_dependencies: ["tomli>=2.0.1"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.4.3"
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.7.0"
hooks:
- id: ruff-format
args: ["--config", "pyproject.toml"]
- id: ruff
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix", "--config", "pyproject.toml"]
- repo: https://github.com/rbubley/mirrors-prettier
rev: "v3.3.3"
hooks:
Expand Down
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# pyproject-fmt mirror

[![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)
[![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)
[![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)

The source code for this project now lives inside
[toml-fmt](https://github.com/tox-dev/toml-fmt/tree/main/pyproject-fmt), this repository serves only as a mirror for
pre-commit.
Mirror of [`pyproject-fmt`](https://github.com/tox-dev/toml-fmt/tree/main/pyproject-fmt) for
[pre-commit](https://github.com/pre-commit/pre-commit).

### Using `pyproject-fmt` with pre-commit

Add it to your `.pre-commit-config.yaml`:

```yaml
- repo: https://github.com/pre-commit/pyproject-fmt
rev: "" # Use the sha / tag you want to point at
hooks:
- id: pyproject-fmt
```
143 changes: 0 additions & 143 deletions pyproject.toml

This file was deleted.

10 changes: 10 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from __future__ import annotations

from setuptools import setup


setup(
name="pre_commit_placeholder_package",
version="0.0.0",
install_requires=["pyproject-fmt==2.4.3"],
)
56 changes: 0 additions & 56 deletions tasks/mirror.py

This file was deleted.

Loading
Loading