Skip to content

Commit

Permalink
Add mirror logic
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <[email protected]>
  • Loading branch information
gaborbernat committed Oct 31, 2024
1 parent f19a38f commit 987623c
Show file tree
Hide file tree
Showing 11 changed files with 136 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tidelift: "pypi/tox-toml-fmt"
13 changes: 13 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Security Policy

## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 1.0.0 + | :white_check_mark: |
| < 1.0.0 | :x: |

## Reporting a Vulnerability

To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift
will coordinate the fix and disclosure.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
5 changes: 5 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
changelog:
exclude:
authors:
- dependabot
- pre-commit-ci
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=tox-toml-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 -f
if: ${{ github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.*_cache
.tox
__pycache__
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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/python-jsonschema/check-jsonschema
rev: 0.29.4
hooks:
- id: check-github-workflows
args: ["--verbose"]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies: ["tomli>=2.0.1"]
- repo: https://github.com/rbubley/mirrors-prettier
rev: "v3.3.3"
hooks:
- id: prettier
name: Prettier
args: ["--print-width=120", "--prose-wrap=always"]
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
8 changes: 8 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- id: tox-toml-fmt
name: tox-toml-fmt
description: apply a consistent format to `pyproject.toml` files
entry: tox-toml-fmt
language: python
language_version: python3
files: '(^|/)tox\.toml$'
types: [file, text, toml]
18 changes: 18 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# tox-toml-fmt
# tox-toml-fmt mirror

[![Main](https://github.com/tox-dev/tox-toml-fmt/actions/workflows/main.yaml/badge.svg)](https://github.com/tox-dev/tox-toml-fmt/actions/workflows/main.yaml)

Mirror of [`tox-toml-fmt`](https://github.com/tox-dev/toml-fmt/tree/main/tox-toml-fmt) for
[pre-commit](https://github.com/pre-commit/pre-commit).

### Using `tox-toml-fmt` with pre-commit

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

```yaml
- repo: https://github.com/pre-commit/tox-toml-fmt
rev: "" # Use the sha / tag you want to point at
hooks:
- id: tox-toml-fmt
```
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=["tox-toml-fmt==2.4.3"],
)

0 comments on commit 987623c

Please sign in to comment.