From db2df36051d6a04389681126bbdfb765c148d61c 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 | 11 +++++++++++ .pre-commit-config.yaml | 9 +++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.clang-format b/.clang-format index da7de461f..409e1a6a8 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 b950b8421..46759ed8d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -216,6 +216,17 @@ 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 000000000..2ee88c069 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + exclude: fuzz_test_corpus + - id: check-yaml + - id: check-added-large-files