lintr icon indicating copy to clipboard operation
lintr copied to clipboard

Static Code Analysis for R

Results 314 lintr issues
Sort by recently updated
recently updated
newest added

In {data.table}, for historical reasons we use the extension .Rraw for test files, thus [we have to run](https://github.com/Rdatatable/data.table/blob/014c82fd7b04e6e41da9680d41b25620a11f46b6/.github/workflows/lint.yaml#L31): ```r lintr::lint_package(pattern = "(?i)[.](r|rmd|rraw)$") ``` (we don't use any of the other...

config

In https://github.com/topepo/caret/pull/1361, I came across a lot of partially-matched argument calls, especially `seq(along=` and `seq(length=` (should be `seq(along.with=` and `seq(length.out=)`, respectively). It would be good to have a linter for...

object linters 🏀
new-linter

R accepts single-line bodies, without curly braces, for the`if` and the `for` statements. Is there any reason why lintr accepts that for `if` but not for `for`? For instance: ```...

false-positive
indentation 📏

Although the documentation for `invisible()` mentions > Return a (temporarily) invisible copy of an object it will actually return only if it's the _last_ line in the function, otherwise the...

feature

Although R CMD check can detect such usages, it might be a nice feature to detect this statically. ``` r dir Duration: 36.4s #> #> ❯ checking R code for...

object linters 🏀

Check in question: https://github.com/r-lib/lintr/blob/36f668e5f88628c3dfd0c9d07cf3f340b2dd2329/.dev/roxygen_test.R#L49-L52 E.g. https://github.com/r-lib/lintr/actions/runs/8534145946/job/23378026136 ```r Warning messages: 1: In Sys.setlocale("LC_COLLATE", LOCALE) : OS reports request to set locale to "en_US" cannot be honored 2: In Sys.setlocale("LC_COLLATE", LOCALE) :...

internals
automation :robot:

#1088 is a regression owing to an accidental extension of cases when `object_usage_linter()` applies in #1082. The fix to restore the old behavior is easy enough, but we should extend...

feature
object linters 🏀

https://github.com/jimhester/lintr/blob/c531b50fb2cd699efad73fd818c00bcea144a914/R/methods.R#L137 This should (and would after #755 is merged) lint because `row.names` is not snake_case and `row` is not a generic. However, the lint should actually be suppressed in this...

feature
object linters 🏀

Some code editors (e.g. vscode) supports [code actions](https://code.visualstudio.com/docs/editor/refactoring) to allow language server to provide code refactoring or fixes via the [language server protocol](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction). In [languageserver](https://github.com/REditorSupport/languageserver), I'm trying to support code...

help wanted :heart:
feature

When I call `lintr::lint` on a file, it runs `get_source_expression` regardless if the file should be [excluded](https://github.com/jimhester/lintr/blob/1a7114b87c4d672772c74ffc30c932dcdb3ce017/R/lint.R#L36) I think if we move the `get_source_expression` down a few lines, this should...

performance