Skip to content

Commit 219dacf

Browse files
committed
Document changes
1 parent 495d3df commit 219dacf

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@
7474
* Added check for `.lintr` configuration file in the `.github/linters` project sub folder. This is to improve
7575
compatibility with Super-Linter(#1746, @tonyk7440)
7676

77+
* The {lintr} configuration file is now searched in the system's user configuration path; the lintr config filename can
78+
also be configured explicitly by setting the environment variable `R_LINTR_LINTER_FILE` (#460, @klmr)
79+
7780
### New linters
7881

7982
* `unnecessary_lambda_linter()`: detect unnecessary lambdas (anonymous functions), e.g.

vignettes/lintr.Rmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ exclusions: list(
9191
More generally, `lintr` searches for a settings file according to following prioritized list.
9292
The first one found, if any, will be used.
9393

94-
1. If `options(lintr.linter_file)` is an absolute path, this file will be used. The default for this option is `".lintr"`.
94+
1. If `options(lintr.linter_file)` is an absolute path, this file will be used. The default for this option is `".lintr"` or the value of the environment variable `R_LINTR_LINTER_FILE`, if set.
9595
2. A linter file (that is a file named like `lintr.linter_file`) in the currently searched directory, i.e. the directory of the file passed to `lint()`. When run from `lint_package()`, this directory can differ for each linted file.
9696
3. A linter file in a parent directory of the currently-searched directory, starting from the deepest path, moving upwards one level at a time.
9797
4. A linter file in the user's `HOME` directory.
9898
5. A linter file in the `.github/linters` child directory of the currently-search directory.
99+
6. A linter file called `config` in the user's configuration path (given by `tools::R_user_dir("lintr", which = "config")`).
99100

100101
If no linter file is found, only default settings take effect (see [defaults](#defaults)).
101102

0 commit comments

Comments
 (0)