Skip to content

Commit

Permalink
Document changes
Browse files Browse the repository at this point in the history
  • Loading branch information
klmr committed Nov 3, 2022
1 parent 495d3df commit 219dacf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
* Added check for `.lintr` configuration file in the `.github/linters` project sub folder. This is to improve
compatibility with Super-Linter(#1746, @tonyk7440)

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

### New linters

* `unnecessary_lambda_linter()`: detect unnecessary lambdas (anonymous functions), e.g.
Expand Down
3 changes: 2 additions & 1 deletion vignettes/lintr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ exclusions: list(
More generally, `lintr` searches for a settings file according to following prioritized list.
The first one found, if any, will be used.

1. If `options(lintr.linter_file)` is an absolute path, this file will be used. The default for this option is `".lintr"`.
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.
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.
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.
4. A linter file in the user's `HOME` directory.
5. A linter file in the `.github/linters` child directory of the currently-search directory.
6. A linter file called `config` in the user's configuration path (given by `tools::R_user_dir("lintr", which = "config")`).

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

Expand Down

0 comments on commit 219dacf

Please sign in to comment.