Skip to content

Commit

Permalink
Add pre-commit & clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
AnyaCoder committed Oct 10, 2024
1 parent 84901b9 commit c1f0d72
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: pre-commit

on:
pull_request:
push:
branches:
- main

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pre-commit/[email protected]
with:
extra_args: --all-files
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ci:
autoupdate_schedule: monthly

repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.6 # ʹÓÃÄãÐèÒªµÄ°æ±¾
hooks:
- id: clang-format
args: ["--style=file", "-i"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: mixed-line-ending
args: ['--fix=lf']
- id: check-added-large-files
args: ['--maxkb=5000']

0 comments on commit c1f0d72

Please sign in to comment.