From 93487f032f1307b54c907d2d909639f492f79f24 Mon Sep 17 00:00:00 2001 From: JesseBot Date: Sun, 25 Dec 2022 16:36:55 +0100 Subject: [PATCH] doc updates for precommit git hooks (#131) --- docs/cli/git/git.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/cli/git/git.md b/docs/cli/git/git.md index 7ce14cd2..3853b4dc 100644 --- a/docs/cli/git/git.md +++ b/docs/cli/git/git.md @@ -14,8 +14,9 @@ overnight. And even if you git good, you might forget stuff. I forget stuff all the time, so I have a doc here to help me remember all the little things. ## precommit hooks with `pre-commit` -I recently learned about [pre-commit][1]. I found it when looking at [ruff][2] -to see if it made sense for pre-commit hooks. +I recently learned about [pre-commit][1]. + +I found it when looking at [ruff][2] to see if it made sense for pre-commit hooks. ```yaml repos: @@ -34,6 +35,18 @@ hooks: verbose: true ``` +[nbdev](https://nbdev.fast.ai/tutorials/pre_commit.html) also has pre commit hooks: + +```yaml +repos: +- repo: https://github.com/fastai/nbdev + rev: 2.2.10 + hooks: + - id: nbdev_clean + - id: nbdev_export +``` + + ## Ignore everything except a few files Thanks to [this stackoverflow thread](https://stackoverflow.com/q/987142).