NEWS.md

lintr 3.1.1

Breaking changes

Bug fixes

Changes to default linters

New and improved features

New linters

Extensions to existing linters

Lint accuracy fixes: removing false positives

Lint accuracy fixes: removing false negatives

lintr 3.1.0

Deprecations & Breaking Changes

Bug fixes

Changes to defaults

New and improved features

Typically, linters should not themselves cause R to stop -- syntax errors lead to error lints, for example. Please report such failures as they are likely bugs.

New linters

Notes

For {tufte} and {bookdown} in particular, one only needs to load the package namespace to accomplish this (i.e., minimally loadNamespace("tufte") or loadNamespace("bookdown"), respectively, will register those packages' custom engines; since library() also runs loadNamespace(), running library() will also work). Note further that {tufte} only added this code to their .onLoad() recently after our request to do so (see https://github.com/rstudio/tufte/issues/117). Therefore, ensure you're using a more recent version to get the behavior described here for {tufte}.

More generally, there is no requirement that loadNamespace() will register a package's custom {knitr} engines, so you may need to work with other package authors to figure out a solution for other engines.

Thanks to Yihui and other developers for their helpful discussions around this issue (#797, @IndrajeetPatil).

lintr 3.0.2

lintr 3.0.1

Changes to defaults

New and improved features

Bug fixes

Other changes

lintr 3.0.0

Breaking changes

This means that usage such as lint("file.R", seq_linter) should be updated to lint("file.R", seq_linter()), and the following update for custom linters:

```r my_custom_linter <- function(source_expression) { ... }

# becomes my_custom_linter <- function() Linter(function(source_expression) { ... }) `` * Exclusions specified in the.lintrfile are now relative to the location of that file and support excluding entire directories (#158, #438, @AshesITR). * Removed long-deprecated linters (they've been marked as deprecated since v1.0.1 in 2017): +absolute_paths_linter()+camel_case_linter()+multiple_dots_linter()+snake_case_linter()+trailing_semicolons_linter()* Removedreturn()fromall_undesirable_functionsbecause early returns (which often improve readability and reduce code complexity) require explicit use ofreturn(). Follow #1100 for an upcomingreturn_linter()to lint unnecessaryreturn()` statements (#1146, @AshesITR).

Note that you can replicate old behavior by supplying return as a custom undesirable function: undesirable_function_linter(c(all_undesirable_functions, list(return = NA)))

Deprecations

Other changes to defaults

Updates to default_linters

Other noteworthy changes

New and improved features

New linters

Google linters

Google is a heavy user of lintr internally, and has developed a large set of linters improving code consistency and correcting common R usage mistakes. This release includes many of these linters that are of general interest to the broader R community. More will be included in future releases. See, e.g.

884, #979, #998, #1011, #1016, #1036, #1051, #1066, and #1067; special thanks to @MichaelChirico and @michaelquinn32.

Other features and improvements

Bug fixes

Internals

lintr 2.0.1

New features

Minor fixes and features

lintr 2.0.0

lintr 2.0.0 is a major release, and incorporates development changes since the last major release (1.0.0) in 2016-04-16.

Deprecated functions

New linters

New functions for writing linters

New functions for users

Linter fixes

General improvements and fixes

lintr 1.0.3

lintr 1.0.2

lintr 1.0.1

lintr 1.0.0

lintr 0.3.3

lintr 0.2.0



Try the lintr package in your browser

Any scripts or data that you put into this service are public.

lintr documentation built on Nov. 7, 2023, 5:07 p.m.