@@ -366,21 +366,31 @@ should set this with the field `verbose: true`.
366366
367367```
368368 id: lintr
369- args: [--warn-only , --load-package ]
369+ args: [--warn_only , --load_package ]
370370 verbose: true
371371```
372372
373- - ` warn-only ` : Changes the behavior of the pre-commit to be
373+ - ` warn_only ` : Changes the behavior of the pre-commit to be
374374 non-blocking. When configured this way, lintr prints lint errors as
375375 they appear.
376376
377- - ` load-package ` : When linting a package, {lintr} uses
378- ` pkgload::load_all() ` to load the package before running
379- ` lintr::lint() ` . Note that you need to list all dependencies of the
380- package under ` additional_dependencies: ` for the ` lintr: ` hook in
381- your ` .pre-commit-config.yaml ` . You can generate the code snip o for
382- c/p with ` snippet_generate("additional-deps-lintr") ` . This argument
383- was added in 0.4.3.9005.
377+ - ` load_package ` : When linting an R package, {lintr} can use
378+ ` pkgload::load_all() ` to load your package before running ` lintr::lint() ` .
379+ This allows {lintr} to:
380+ - Recognize internal and exported functions, classes, and methods.
381+ - Read the NAMESPACE to correctly resolve imported functions.
382+
383+ Note that your package's dependencies must be listed in
384+ ` additional_dependencies: ` in your ` .pre-commit-config.yaml ` as shown
385+ below. You can generate these for easy c/p with
386+ ` snippet_generate("additional-deps-lintr") ` . This argument was added in
387+ version 0.4.3.9005.
388+ ```
389+ id: lintr
390+ args: [--load_package]
391+ additional_dependencies:
392+ - dplyr
393+ ```
384394
385395The `.lintr` config file as documented in the [`.lintr`
386396documentation](https://github.com/r-lib/lintr#project-configuration) is
0 commit comments