Skip to content

Commit

Permalink
To fix nbformat pre-commit instructions...
Browse files Browse the repository at this point in the history
The current instructions did not work from me and didn't seem to match the usage in the [pre-commit docs](https://pre-commit.com/).

I believe that these changes (almost) address the issue by

a) specifying that the YAML contents go in a `.pre-commit-config.yaml` file`;
b) clarifying that `.pre-commit-hooks.yaml` is a pre-commit plugin; and
c) completing the config YAML by specifying which `hooks` to run (from the plugin)

However, this still won't work because `.pre-commit-hooks.yaml` is not located at the root of the repo (as required in https://pre-commit.com/#new-hooks). Am I missing something? E.g. is tools/tensorflow_docs/tools intended as some sort of sub-repo?
  • Loading branch information
jorgeorpinel committed Jun 13, 2023
1 parent 2640af9 commit dd6c1f4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tools/tensorflow_docs/tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@ this, use a standard Git hook or use the
[https://pre-commit.com/](https://pre-commit.com/) framework to create the hook
for you.

If you want to use pre-commit to handle the hook installation for you, include
the [.pre-commit-hooks.yaml](./.pre-commit-hooks.yaml) file in your repo with
the following contents:
If you want to use pre-commit to handle the hook installation for you, create a
`.pre-commit-config.yaml` file with the contents below to include the `nbformat`
hook from the [.pre-commit-hooks.yaml](./.pre-commit-hooks.yaml) plugin.

```
repos:
- repo: https://github.com/tensorflow/docs
rev: pre-commit
rev: 2023.5.24.56664
hooks:
- id: nbformat
```

Someone who clones that repo for development would then install the hook with:
Expand Down

0 comments on commit dd6c1f4

Please sign in to comment.