You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,20 +8,20 @@ This repo uses the [tic](https://github.com/ropenscilabs/tic) package for CI.
8
8
9
9
To create a new hook, have a look at the [official
10
10
documentation](https://pre-commit.com/#new-hooks) on creating new hooks, then have a look
11
-
at existing hooks in this repo. The actual executables are defined in [`inst/hooks/`](https://github.com/lorenzwalthert/precommit/tree/master/inst/hooks). In
11
+
at existing hooks in this repo. The actual executables are defined in [`inst/hooks/`](https://github.com/lorenzwalthert/precommit/tree/main/inst/hooks). In
12
12
the script, you can expect the passed command line arguments to be all options,
13
13
finally the files that should be processed with the hook.
14
14
15
15
For the scripts to become a hook, they need to be *registered* in
16
-
[`.pre-commit-hooks.yaml`](https://github.com/lorenzwalthert/precommit/blob/master/.pre-commit-hooks.yaml). As R is not currently a supported language of
16
+
[`.pre-commit-hooks.yaml`](https://github.com/lorenzwalthert/precommit/blob/main/.pre-commit-hooks.yaml). As R is not currently a supported language of
17
17
pre-commit (https://github.com/pre-commit/pre-commit/issues/926), most hooks use
18
18
`language: script` and then a shebang in the `entrypoint` script.
19
19
20
20
# Testing hooks
21
21
22
22
Hooks should be tested by checking both the positive outcome (hook passes) and
23
23
the negative outcome (hook fails) by adding two `run_test()` statements to
24
-
[`./tests/testthat/test-all.R`](https://github.com/lorenzwalthert/precommit/blob/master/tests/testthat/test-all.R). Look at existing examples and [the documentation
24
+
[`./tests/testthat/test-all.R`](https://github.com/lorenzwalthert/precommit/blob/main/tests/testthat/test-all.R). Look at existing examples and [the documentation
25
25
of `run_test()`](https://lorenzwalthert.github.io/precommit/reference/run_test.html). Note that this won't actually use pre-commit. It will simply
26
26
call the hook script the same way as pre-commit would, with the difference that
27
27
the test uses a path to the `Rscript` executable whereas with pre-commit, the
0 commit comments