Skip to content

Commit e5f1ff7

Browse files
check links and update news
1 parent c37b9fd commit e5f1ff7

File tree

3 files changed

+93
-77
lines changed

3 files changed

+93
-77
lines changed

NEWS.md

Lines changed: 89 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,130 @@
1-
# precommit v0.1.3.9114-* (Development)
2-
3-
This version marks the switch to `language: r` of all existing hooks. This
4-
includes switching to R based hook for `readme-rmd-render`, avoiding the
5-
{usethis} dependency, integration tests via GitHub Actions, auto-updates for
6-
used packages, roxygen snippet generation and more. In addition:
7-
8-
* `use_precommit()` gains a `ci` argument, defaulting to `"native"`, which will
9-
guide the user to set up continuous integration of the hooks with either
10-
[pre-commit.ci](https://pre-commit.ci) or
11-
[GitHub Actions](https://github.com/features/actions). New exported
12-
function `use_ci(ci = "native")` can be used to migrate existing repos. The
13-
default behavior for `ci` is governed by the R option `precommit.ci`.
14-
* `use_precommit(..., install_hooks = TRUE)` is no longer blocking by default.
15-
New option `precommit.block_install_hooks` (defaults to `FALSE`) governs the
16-
behavior (#312).
17-
* Always sort `inst/WORDLIST` (#303).
18-
* rename default branch to *main* (#307).
19-
* `style-files` hook gains an argument `--cache-root` that is passed to
20-
`options(styler.cache_root = ...)` (#305).
21-
* Use dev version of {lintr} to reduce total dependencies from 71 to 59 that
22-
brings down install time.
23-
* Use LF line endings in git config to ensure passing tests on Windows for R
24-
devel (#321).
25-
* `.lintr` and `.gitlab-ci.yml` are not ignored in the spell check hook (#317).
26-
27-
# precommit v0.1.3.9012
28-
29-
This is a pre-release for `v0.2.0` and imposes a minimal version requirement
30-
on the [pre-commit framework](https://pre-commit.com/) (`v2.13.0`). Please see
31-
*Installation/Update* below for how to satisfy it. This will ensure future
32-
releases of {precommit} building on the newly supported
33-
[`language: r`](https://pre-commit.com/#r) will work out of the box instead of
34-
issuing messages that are confusing for most end-users. We aspire the transition
35-
to `language: r` due to the following benefits: No more manual dependency management
36-
for hooks nor conflicts with your global R library plus eventually it will
37-
enable the easy use of continuous integration services (enforcing hooks and
38-
auto-fixing problems with pre-commit.ci, GitHub Actions).
39-
1+
# precommit v0.2.0
402

41-
**Installation/Update**
423

43-
Please follow the
44-
[update instructions](https://lorenzwalthert.github.io/precommit/dev/#update) or
45-
[installation instructions](https://lorenzwalthert.github.io/precommit/dev/#installation)
46-
depending on whether or not you previously used pre-commit.
47-
48-
**API changes**
4+
This version marks the switch to [`language: r`](https://pre-commit.com/#r) of
5+
all existing hooks. This means two things:
496

7+
* creation of isolated pre-commit environments: No
8+
more manual dependency management for hooks nor conflicts with your global R
9+
library and more consistent output of hooks from different collaborators in a
10+
project. Thanks to {renv}'s excellent
11+
[caching](https://rstudio.github.io/renv/articles/renv.html#cache-1), this
12+
hardly consumes any space and is fast.
13+
This requires the Python package `pre-commit >= 2.11.1` (ideally even
14+
`>= 2.13.0`). See *Installation/Update** below (#233, #250, #260, #264, #273,
15+
#315, #313, #308, #301, #300, #295, #285).
16+
* support for continuous integration via [pre-commit.ci](https://pre-commit.ci)
17+
and [GitHub Actions]([GitHub Actions](https://github.com/pre-commit/action),
18+
that is, running the pre-commit hooks as part of a CI pipeline. This
19+
means that hook passing can be enforced for pull requests, even if the creator
20+
did not run the hooks locally. Further, the diff from running the hooks is
21+
committed and pushed back to the remote repository. This may fix the failing
22+
hook problems in some cases (e.g. `style-files`). See `vignette("ci")` for a
23+
comparison of the two services (#318).
24+
25+
*API changes**
26+
27+
* `use_precommit()` gains a new argument `ci` defaulting to `"native"` (for
28+
[pre-commit](https://pre-commit.ci)) to set up continuous
29+
integration. Other allowed values are `"gha"` (for
30+
[GitHub Actions]([GitHub Actions](https://github.com/pre-commit/action)) or
31+
`NULL` (for no CI).
32+
* The new exported function `use_ci(ci = "native")` can be used to set up
33+
continuous integration for existing repos. The default behavior for `ci` for
34+
both functions is governed by the R option `precommit.ci`.
5035
- `version_precommit()` and `update_precommit()` are new functions to check the
5136
version of the installed pre-commit executable and to update it (#197).
37+
* `style-files` hook gains an argument `--cache-root` that is passed to
38+
`options(styler.cache_root = ...)` (#305).
5239
- `style-files` hook now supports the full
5340
[`style_file()`](https://styler.r-lib.org/dev/reference/style_file.html) API,
5441
e.g. you can supply `--scope=spaces` and similar via `args:` in your
5542
`.pre-commit-config.yaml`. See the
5643
[docs](https://lorenzwalthert.github.io/precommit/articles/available-hooks.html#style-files-1)
5744
for details.
45+
- `style-files` and `roxygenize` hooks now warn if there is no permanent
46+
`{R.cache}` cache set up. You can silence the warning with the hook argument
47+
`--no-warn-cache` (#225).
5848

59-
**Major Changes**
6049

61-
- {precommit} now uses [`language: r`](https://pre-commit.com/#r) instead of
62-
`language: script` from the [pre-commit framework](https://pre-commit.com).
63-
This requires `pre-commit >= 2.11.1` (ideally even `>= 2.13.0`). All hooks and
64-
dependencies are now contained in a virtual environment with
65-
[`{renv}`](https://rstudio.github.io/renv/). Thanks to {renv}'s excellent
66-
[caching](https://rstudio.github.io/renv/articles/renv.html#cache-1), this
67-
hardly consumes any space and is fast. This makes output
68-
of hooks more consistent across different local setups, make manual dependency
69-
management redundant and will facilitate running R hooks as part of CI/CD in
70-
the future, e.g. via https://pre-commit.ci or
71-
[GitHub Actions](https://github.com/pre-commit/action) along with hook
72-
implemented in other languages (#233, #250, #260, #264, #273).
50+
**Installation/Update**
51+
52+
Please follow the
53+
[update instructions](https://lorenzwalthert.github.io/precommit/dev/#update) or
54+
[installation instructions](https://lorenzwalthert.github.io/precommit/dev/#installation)
55+
depending on whether or not you previously used pre-commit.
56+
57+
58+
**Major changes**
59+
7360
- Because hooks run in a virtual environment and the `roxygenize` hook runs
7461
`pkgload::load_all()`, you need to list all dependencies of your package in
7562
`additional_dependencies` field in `.pre-commit-config.yaml`. You will be
7663
prompted to add them if they are missing,
7764
`precommit::snippet_generate("additional-deps-roxygenize")` generates
7865
the code you can copy/paste (#247, #248, #249).
66+
67+
- In order to avoid multiple installations of the pre-commit framework, a
68+
warning is issued if multiple are found so the user can remove them (#266,
69+
#273, #277, #278).
70+
* `use_precommit(..., install_hooks = TRUE)` is no longer blocking by default.
71+
New option `precommit.block_install_hooks` (defaults to `FALSE`) governs the
72+
behavior (#312).
73+
* Always sort `inst/WORDLIST` (#303).
74+
* `.lintr` and `.gitlab-ci.yml` are not ignored in the spell check hook (#317).
7975
- Warnings are no longer promoted to errors in the styler hook, which is
8076
particularly relevant for the apparently random error
8177
`Unknown or uninitialised column: text` (#268).
8278
- `deps-in-desc` now checks `.Rprofile`, `.Rmd` and `.Rnw` files in addition to
8379
`.R` files (#216).
84-
- `style-files` and `roxygenize` hooks now warn if there is no permanent
85-
`{R.cache}` cache set up. You can silence the warning with the hook argument
86-
`--no-warn-cache` (#225).
8780
- the lintr and styler hook now also check `.Rmd`, `.Rnw` and `.Rprofile` files
88-
(#286).
89-
90-
**Minor changes**
91-
92-
- In order to avoid multiple installations of the pre-commit framework, a
93-
warning is issued if multiple are found so the user can remove them (#266,
94-
#273, #277, #278).
95-
- The cache for the roxygen2 hook is now also invalidated for changes in formals
96-
if there are no changes in roxygen comments (#214).
81+
(#287).
9782
- `{renv}` infra files are not checked anymore by default in the template config
9883
files (#237).
9984
- `.png`, `.jpeg`, `.pdf` and files in `.github/workflows` are no longer
10085
spell-checked in the template config file (#276).
101-
- All sub-patterns in the `exclude:` pattern of the spell check hook are now
102-
ordered alphabetically (#276).
86+
87+
88+
**Minor changes**
89+
90+
* rename default branch to *main* (#307).
91+
* Use dev version of {lintr} to reduce total dependencies from 71 to 59 that
92+
brings down install time.
10393
- The location of the pre-commit executable is now also recognized on Apple
10494
Silicon when installed with Homebrew (#240).
95+
- pinning python version to 3.9 for conda until problems related to 3.10 are
96+
fixed (#310).
97+
- The cache for the roxygen2 hook is now also invalidated for changes in formals
98+
if there are no changes in roxygen comments (#214).
99+
- All sub-patterns in the `exclude:` pattern of the spell check hook are now
100+
ordered alphabetically (#276).
105101
- The `deps-in-desc` hook now points to the hook argument
106102
`--allow_private_imports` when the hook fails due to private imports (#254).
107103
- roxygenize hook is now fully tested (#267).
108104
- Hook scripts were relocated and R hooks now have a file extension (#280).
109105
- Hook dependency updates are proposed by an automatic monthly pull request
110106
to `lorenzwalthert/precommit`. This does not affect users directly (#430).
111107
- Updated GitHub Action workflows (#288).
108+
* Use LF line endings in git config to ensure passing tests on Windows for R
109+
devel (#321).
110+
- fixing typos (#289).
111+
- fix R CMD Check (#284).
112+
113+
114+
A big hand to all the contributors of this release:
115+
116+
[@adamblake](https://github.com/adamblake),
117+
[@arbues6](https://github.com/arbues6),
118+
[@b4D8](https://github.com/b4D8),
119+
[@bart1](https://github.com/bart1),
120+
[@dhersz](https://github.com/dhersz), [@github-actions[bot]](https://github.com/github-actions[bot]), [@joelnitta](https://github.com/joelnitta),
121+
[@jucor](https://github.com/jucor),
122+
[@lorenzwalthert](https://github.com/lorenzwalthert), [@lukasfeick-sw](https://github.com/lukasfeick-sw), [@MarkMc1089](https://github.com/MarkMc1089),
123+
[@njtierney](https://github.com/njtierney),
124+
[@pat-s](https://github.com/pat-s), [@pre-commit-ci[bot]](https://github.com/pre-commit-ci[bot]), [@pwildenhain](https://github.com/pwildenhain), and [@rossdrucker](https://github.com/rossdrucker)
125+
126+
For previous versions of `NEWS.md` with news bullet per patch release, see the
127+
[latest `NEWS.md` before gathering](https://github.com/lorenzwalthert/precommit/blob/7a8740714ab868d20e981b8b80898d7be050e34e/NEWS.md).
112128

113129
# precommit v0.1.3
114130

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ knitr::opts_chunk$set(
1818
[![CRAN
1919
status](https://www.r-pkg.org/badges/version/precommit)](https://CRAN.R-project.org/package=precommit)
2020
[![Lifecycle:
21-
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
21+
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
2222
[![R build
2323
status](https://github.com/lorenzwalthert/precommit/workflows/R-CMD-check/badge.svg)](https://github.com/lorenzwalthert/precommit/actions)
2424
<!-- badges: end -->

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![CRAN
99
status](https://www.r-pkg.org/badges/version/precommit)](https://CRAN.R-project.org/package=precommit)
1010
[![Lifecycle:
11-
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
11+
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
1212
[![R build
1313
status](https://github.com/lorenzwalthert/precommit/workflows/R-CMD-check/badge.svg)](https://github.com/lorenzwalthert/precommit/actions)
1414
<!-- badges: end -->
@@ -64,7 +64,7 @@ Alternatively, you can handle the installation from R using
6464
[miniconda](https://docs.conda.io/en/latest/miniconda.html):
6565

6666
- install miniconda if you don’t have it already:
67-
`reticulate::install_miniconda()`. This needs reticulate &gt;= 1.14.
67+
`reticulate::install_miniconda()`. This needs reticulate >= 1.14.
6868

6969
- install the pre-commit framework with
7070
`precommit::install_precommit()` into the conda environment
@@ -104,7 +104,7 @@ If all hooks pass, the commit is made. You can also [temporarily disable
104104
hooks](https://pre-commit.com/#temporarily-disabling-hooks). If you
105105
succeed, it should look like this:
106106

107-
<img src="man/figures/screenshot.png" width="639" />
107+
![](man/figures/screenshot.png)<!-- -->
108108

109109
See the hooks provided by this repo under `vignette("available-hooks")`.
110110
You can also add other hooks from other repos, by extending the

0 commit comments

Comments
 (0)