From 9f94ac714804156ff129e88e2f40a332592e6ae1 Mon Sep 17 00:00:00 2001 From: ymh Date: Sat, 1 Jun 2024 21:58:31 +0800 Subject: [PATCH] README.md: Clarify the pre-commit stuff more --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b9e7766..e96b402 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,9 @@ To see what it'll look like, locally: Build the docs site with `mkdocs build`; s I recommend using [this extension for Markdown linting](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint). -### Pre-commit +### Using pre-commit locally + +Using `pre-commit` locally is usually faster than waiting for the GH workflow. #### To install locally @@ -35,22 +37,21 @@ brew install pre-commit # navigate to this repo cd internal_docs - # install the git hook scripts + # install the git hook scripts. pre-commit will now run on every commit. pre-commit install +pre-commit autoupdate # bring the hooks to the latest tag on the default branch ``` > Every time you clone a project using pre-commit, running `pre-commit install` should always be the first thing you do. See docs at [https://pre-commit.com/](https://pre-commit.com/) for more info. -#### Then, to run the hooks against the files locally +#### To manually run all pre-commit hooks against the files locally ```bash pre-commit run --all-files ``` -This is usually faster than waiting for the GH workflow. - ### Why pre commit and markdown linting Yongming noticed that parts of the site weren't rendering properly because the markdown was not valid. Using precommit and markdown linting should help with that.