├── .github └── workflows │ └── main.yml ├── .pre-commit-hooks.yaml ├── .version ├── LICENSE ├── README.md └── setup.py /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: main 2 | on: 3 | push: 4 | branches: [main] 5 | schedule: 6 | - cron: '55 8 * * *' 7 | 8 | jobs: 9 | build: 10 | name: main 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | - uses: actions/setup-python@v2 15 | - run: pip install pre-commit-mirror-maker 16 | - run: git config --global user.name 'Github Actions' 17 | - run: git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' 18 | - run: pre-commit-mirror . --language=python --package-name=clang-format --id=clang-format --entry='clang-format -i' --types-or c++ --types-or c --types-or 'c#' --types-or 'cuda' --types-or 'java' --types-or 'javascript' --types-or 'json' --types-or 'objective-c' --types-or 'proto' --types-or 'textproto' --types-or 'metal' --args=-style=file 19 | - run: | 20 | git remote set-url origin https://x-access-token:$GH_TOKEN@github.com/$GITHUB_REPOSITORY 21 | git push origin HEAD:refs/heads/main --tags 22 | env: 23 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 24 | -------------------------------------------------------------------------------- /.pre-commit-hooks.yaml: -------------------------------------------------------------------------------- 1 | - id: clang-format 2 | name: clang-format 3 | description: '' 4 | entry: clang-format -i 5 | language: python 6 | 'types_or': [c++, c, c#, cuda, java, javascript, json, objective-c, proto, textproto, metal] 7 | args: ["-style=file"] 8 | require_serial: false 9 | additional_dependencies: [] 10 | minimum_pre_commit_version: '2.9.2' 11 | -------------------------------------------------------------------------------- /.version: -------------------------------------------------------------------------------- 1 | 20.1.5 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021 Anthony Sottile 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | clang-format mirror 2 | =================== 3 | 4 | Mirror of `clang-format` package for pre-commit. 5 | 6 | For pre-commit: see https://github.com/pre-commit/pre-commit 7 | 8 | For clang-format: see https://github.com/ssciwr/clang-format-wheel 9 | 10 | 11 | ### Using clang-format with pre-commit 12 | 13 | Add this to your `.pre-commit-config.yaml`: 14 | 15 | ```yaml 16 | - repo: https://github.com/pre-commit/mirrors-clang-format 17 | rev: '' # Use the sha / tag you want to point at 18 | hooks: 19 | - id: clang-format 20 | ``` 21 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 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=['clang-format==20.1.5'], 10 | ) 11 | --------------------------------------------------------------------------------