Skip to content

Commit

Permalink
Add pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
benemer committed Sep 20, 2024
1 parent 3ef3bfd commit 9fd8b19
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Style Check

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
pre-commit:
name: Pre-commit checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: pre-commit/action@v3.0.0
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: v4.4.0
hooks:
- id: trailing-whitespace
exclude: \.patch$
- id: end-of-file-fixer
exclude: \.patch$
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.0
hooks:
- id: clang-format
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/ahans/cmake-format-precommit
rev: 8e52fb6506f169dddfaa87f88600d765fca48386
hooks:
- id: cmake-format
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort

0 comments on commit 9fd8b19

Please sign in to comment.