Skip to content

Commit 905b088

Browse files
rwgkcopybara-github
authored andcommitted
Add basic .pre-commit-config.yaml and pre-commit.yml workflow.
Preparation for importing pybind#73 PiperOrigin-RevId: 512773443
1 parent 80f3440 commit 905b088

File tree

4 files changed

+63
-12
lines changed

4 files changed

+63
-12
lines changed

.github/auto_assign-issues.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/pre-commit.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-python@v4
14+
- uses: pre-commit/[email protected]
15+
with:
16+
# Slow hooks are marked with manual - slow is okay here, run them too
17+
extra_args: --hook-stage manual --all-files

.pre-commit-config.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# To use:
2+
#
3+
# pre-commit run -a
4+
#
5+
# Or:
6+
#
7+
# pre-commit install # (runs every time you commit in git)
8+
#
9+
# To update this file:
10+
#
11+
# pre-commit autoupdate
12+
#
13+
# See https://github.com/pre-commit/pre-commit
14+
15+
16+
ci:
17+
autoupdate_commit_msg: "chore(deps): update pre-commit hooks"
18+
autofix_commit_msg: "style: pre-commit fixes"
19+
autoupdate_schedule: quarterly
20+
21+
repos:
22+
23+
- repo: https://github.com/pre-commit/pre-commit-hooks
24+
rev: "v4.4.0"
25+
hooks:
26+
- id: check-added-large-files
27+
- id: check-case-conflict
28+
- id: check-docstring-first
29+
- id: check-merge-conflict
30+
- id: check-symlinks
31+
- id: check-toml
32+
- id: check-yaml
33+
- id: debug-statements
34+
- id: end-of-file-fixer
35+
- id: mixed-line-ending
36+
- id: requirements-txt-fixer
37+
- id: trailing-whitespace
38+
exclude: \.patch?$
39+
40+
- repo: https://github.com/cheshirekow/cmake-format-precommit
41+
rev: "v0.6.13"
42+
hooks:
43+
- id: cmake-format
44+
additional_dependencies: [pyyaml]
45+
types: [file]
46+
files: (\.cmake|CMakeLists.txt)(.in)?$

scripts/build_and_run_tests.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,3 @@ BAZEL_CXXOPTS="-std=c++17" bazel test --test_output=errors \
7575
pybind11_protobuf/tests:pass_by_test \
7676
pybind11_protobuf/tests:proto_enum_test \
7777
pybind11_protobuf/tests:wrapped_proto_module_test
78-
79-

0 commit comments

Comments
 (0)