Skip to content

Commit

Permalink
Add basic .pre-commit-config.yaml and pre-commit.yml workflow.
Browse files Browse the repository at this point in the history
Preparation for importing #73

PiperOrigin-RevId: 512773443
  • Loading branch information
Ralf W. Grosse-Kunstleve authored and copybara-github committed Feb 28, 2023
1 parent 80f3440 commit 905b088
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 12 deletions.
10 changes: 0 additions & 10 deletions .github/auto_assign-issues.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]
with:
# Slow hooks are marked with manual - slow is okay here, run them too
extra_args: --hook-stage manual --all-files
46 changes: 46 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# To use:
#
# pre-commit run -a
#
# Or:
#
# pre-commit install # (runs every time you commit in git)
#
# To update this file:
#
# pre-commit autoupdate
#
# See https://github.com/pre-commit/pre-commit


ci:
autoupdate_commit_msg: "chore(deps): update pre-commit hooks"
autofix_commit_msg: "style: pre-commit fixes"
autoupdate_schedule: quarterly

repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-docstring-first
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: requirements-txt-fixer
- id: trailing-whitespace
exclude: \.patch?$

- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: "v0.6.13"
hooks:
- id: cmake-format
additional_dependencies: [pyyaml]
types: [file]
files: (\.cmake|CMakeLists.txt)(.in)?$
2 changes: 0 additions & 2 deletions scripts/build_and_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,3 @@ BAZEL_CXXOPTS="-std=c++17" bazel test --test_output=errors \
pybind11_protobuf/tests:pass_by_test \
pybind11_protobuf/tests:proto_enum_test \
pybind11_protobuf/tests:wrapped_proto_module_test


0 comments on commit 905b088

Please sign in to comment.