Skip to content

Commit 063d866

Browse files
committed
Pre-commit setup from ExaGO. To test.
1 parent cdf9638 commit 063d866

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/workflows/pre_commit.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: gridkit-bot pre-commit
2+
3+
# Won't run on develop/main directly
4+
on: [pull_request]
5+
6+
jobs:
7+
pre-commit:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
with:
12+
ref: ${{ github.event.pull_request.head.ref }}
13+
- uses: actions/setup-python@v3
14+
- uses: pre-commit/[email protected]
15+
- uses: EndBug/[email protected]
16+
# Only need to try and commit if the action failed
17+
if: failure()
18+
with:
19+
fetch: false
20+
committer_name: GitHub Actions
21+
committer_email: [email protected]
22+
message: Apply pre-commmit fixes
23+

.pre-commit-config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
repos:
2+
- repo: https://github.com/cheshirekow/cmake-format-precommit
3+
rev: v0.6.13
4+
hooks:
5+
- id: cmake-format
6+
- repo: https://github.com/pre-commit/mirrors-clang-format
7+
rev: v10.0.1
8+
hooks:
9+
- id: clang-format
10+
- repo: https://github.com/pre-commit/mirrors-autopep8
11+
rev: v2.0.4
12+
hooks:
13+
- id: autopep8
14+
- repo: https://github.com/pre-commit/pre-commit-hooks
15+
rev: v4.4.0
16+
hooks:
17+
- id: check-toml
18+
- id: forbid-new-submodules
19+
- id: end-of-file-fixer
20+
- id: check-yaml

0 commit comments

Comments
 (0)