From 987623c6d8459c6ae809ed8763923267b35ef121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Wed, 30 Oct 2024 18:20:04 -0700 Subject: [PATCH] Add mirror logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- .github/FUNDING.yml | 1 + .github/SECURITY.md | 13 +++++++++++++ .github/dependabot.yml | 6 ++++++ .github/release.yml | 5 +++++ .github/workflows/main.yml | 29 +++++++++++++++++++++++++++++ .gitignore | 3 +++ .pre-commit-config.yaml | 26 ++++++++++++++++++++++++++ .pre-commit-hooks.yaml | 8 ++++++++ LICENSE.txt | 18 ++++++++++++++++++ README.md | 18 +++++++++++++++++- setup.py | 10 ++++++++++ 11 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/SECURITY.md create mode 100644 .github/dependabot.yml create mode 100644 .github/release.yml create mode 100644 .github/workflows/main.yml create mode 100644 .gitignore create mode 100644 .pre-commit-config.yaml create mode 100644 .pre-commit-hooks.yaml create mode 100644 LICENSE.txt create mode 100644 setup.py diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..731c121 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +tidelift: "pypi/tox-toml-fmt" diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000..5968e5b --- /dev/null +++ b/.github/SECURITY.md @@ -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. diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1230149 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..9d1e098 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,5 @@ +changelog: + exclude: + authors: + - dependabot + - pre-commit-ci diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..6abe7fa --- /dev/null +++ b/.github/workflows/main.yml @@ -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:$GH_TOKEN@github.com/$GITHUB_REPOSITORY + git push origin HEAD:refs/heads/main --tags -f + if: ${{ github.ref == 'refs/heads/main' }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4425c22 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.*_cache +.tox +__pycache__ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..05b579b --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml new file mode 100644 index 0000000..79de924 --- /dev/null +++ b/.pre-commit-hooks.yaml @@ -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] diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..3649823 --- /dev/null +++ b/LICENSE.txt @@ -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. diff --git a/README.md b/README.md index be1b160..fe66f52 100644 --- a/README.md +++ b/README.md @@ -1 +1,17 @@ -# tox-toml-fmt \ No newline at end of file +# 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 +``` diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..9f3b4df --- /dev/null +++ b/setup.py @@ -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"], +)