From e54d5f4216402cd715f026438797a53da748e468 Mon Sep 17 00:00:00 2001 From: Nawaz Hussain K Date: Thu, 13 Jul 2023 17:32:46 -0500 Subject: [PATCH] Run local verifying targets too before committing - verify-boilerplate - verify-modules - verify-shellcheck - verify-tiltfile - verify-codespell - add a note to skip pre-commit config --- .pre-commit-config.yaml | 35 +++++++++++++++++++++++++ docs/book/src/developers/development.md | 3 ++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b045f4a2922..ab6afe23bc1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,3 +20,38 @@ repos: rev: v2.17.2 hooks: - id: pylint +- repo: local + hooks: + - id: make-verify-boilerplate + name: Run make verify-boilerplate + description: Runs `make verify-boilerplate` to check for boilerplate headers. + entry: make verify-boilerplate + language: system +- repo: local + hooks: + - id: make-verify-modules + name: Run make verify-modules + description: Runs `make verify-modules` to verify go.sum go.mod are the latest. + entry: make verify-modules + language: system +- repo: local + hooks: + - id: make-verify-shellcheck + name: Run make verify-shellcheck + description: Runs `make verify-shellcheck` to verify shell files are passing lint. + entry: make verify-shellcheck + language: system +- repo: local + hooks: + - id: make-verify-tiltfile + name: Run make verify-tiltfile + description: Runs `make verify-tiltfile` to verify Tiltfile format. + entry: make verify-tiltfile + language: system +- repo: local + hooks: + - id: make-codespell + name: Run make verify-codespell + description: Runs `make verify-codespell` to verify codespell format. + entry: make verify-codespell + language: system diff --git a/docs/book/src/developers/development.md b/docs/book/src/developers/development.md index c015e33cd89..e494c092ddb 100644 --- a/docs/book/src/developers/development.md +++ b/docs/book/src/developers/development.md @@ -70,9 +70,10 @@ - `sudo apt install make` on Linux. 9. Install [timeout][timeout] - `brew install coreutils` on macOS. -9. Install [pre-commit framework](https://pre-commit.com/#installation) +10. Install [pre-commit framework](https://pre-commit.com/#installation) - `brew install pre-commit` Or `pip install pre-commit`. Installs pre-commit globally. - run `pre-commit install` at the root of the project to install pre-commit hooks to read `.pre-commit-config.yaml` + - *Note*: use `git commit --no-verify` to skip running pre-commit workflow as and when needed. When developing on Windows, it is suggested to set up the project on Windows + WSL2 and the file should be checked out on as wsl file system for better results.