From 6e4cc507d605bcf4c93361e85f6883edcd196e7e Mon Sep 17 00:00:00 2001 From: David Zero Date: Tue, 12 Dec 2023 19:13:22 -0500 Subject: [PATCH] ci: Add pre-commit checks --- .clang-format | 2 -- .github/workflows/ci.yaml | 10 ++++++++++ .pre-commit-config.yaml | 9 +++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.clang-format b/.clang-format index da7de461..409e1a6a 100644 --- a/.clang-format +++ b/.clang-format @@ -159,5 +159,3 @@ WhitespaceSensitiveMacros: - BOOST_PP_STRINGIZE - NS_SWIFT_NAME - CF_SWIFT_NAME ---- - diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b950b842..3ae27923 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -216,6 +216,16 @@ jobs: # being inaccessible. # - run: bazel run browser:tui + pre-commit: + runs-on: ubuntu-22.04 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + - name: Install pre-commit + run: sudo apt-get update && sudo apt-get install pre-commit + - name: Run pre-commit + run: pre-commit run --all-files + clang-format: runs-on: ubuntu-22.04 timeout-minutes: 30 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..3e782d1b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + exclude: fuzz_test_corpus + - id: check-yaml + - id: check-added-large-files