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-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ pre-commit (https://github.com/pre-commit/pre-commit/issues/926), most hooks use
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/main/tests/testthat/test-all.R). Look at existing examples and [the documentation
24
+
[`./tests/testthat/test-hooks.R`](https://github.com/lorenzwalthert/precommit/blob/main/tests/testthat/test-hooks.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
@@ -35,12 +35,11 @@ For this reason, always test the hook manually end-to-end with
35
35
36
36
# Summary
37
37
38
-
- add your script to in `inst/bin` and make it executable. Only R scripts are
39
-
currently supported as testing is done with `Rscript ...`.
38
+
- add your script in `inst/hooks/exported` and make it executable. Only R scripts are currently supported as testing is done with `Rscript ...`. See other scripts in `inst/hooks/exported` for a starting point for setting up your script.
40
39
41
40
- register hook in `.pre-commit-hooks.yaml`.
42
41
43
42
- add two unit tests, test manually with `pre-commit try-repo`.
44
43
45
-
- add a description of the new hook to the `README.Rmd`. Both description and
44
+
- add a description of the new hook to `vignettes/available-hooks.Rmd`. Both description and
0 commit comments