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

Closes #1805 I know that a PR (#1895) already exists, but it doesn't seem to be moving forward anymore. Please give me your opinion on whether information should be output...

One concern I have about the consistency cleanups in this release (#2039, #2046, #2190) is there's no mechanism to ensure future improvements/new linters continue to keep "up to code" &...

internals
testing
automation :robot:

namespace_linter has `namespace_symbols()` already, taking lazydata into account. We can probably refactor this and not use `utils::data()` at all. _Originally posted by @AshesITR in https://github.com/r-lib/lintr/pull/2079#discussion_r1290886304_

internals

``` r 'if (a) { if (b) { if (c) { message("hi") } t if (b) { #> ^~~~~~~~ ``` Created on 2023-01-06 with [reprex v2.0.2](https://reprex.tidyverse.org) But the suggested modification...

lint-metadata

Maybe we should look into allowing wildcard exclusions based on file names? ``` exclusions: list("*.Rmd" = "library_call_linter")) ``` seems readable and concise for your usecase @IndrajeetPatil. WDYT? _Originally posted by...

feature

_Originally posted by @MichaelChirico in https://github.com/r-lib/lintr/pull/2152#discussion_r1323530530_ It's very common to start an Rmd vignette with an `include=FALSE` header setting up metadata: ```{r setup, include=FALSE} knitr::opts_chunk$set(...) ``` ```{r first_visible_cell} library(my.pkg) ```...

false-positive
rmd

As a package maintainer I would like to know whether my _declared_ imports in the DESCRIPTION file are actually _used_ in the code. I managed to find a great third-party...

feature

```r #' @importFrom pkg foo pkg::foo() ``` The latter usage of `foo()` could be linted as `pkg::` is not needed. Such a linter could help backsliding after clean-ups like #2031

feature

Now that we have a series of consistency checks built into `Lint()`: https://github.com/r-lib/lintr/blob/f8bb91e7f0fd749f9a28523006a4cedd369c2688/R/lint.R#L374-L395 It may make sense to offer a vectorized interface for constructing lints so these consistency checks can...

feature
performance

I would put that as a separate linter. The closer analogue is `nested_ifelse_linter()`, whose primary recommended alternatives are `data.table::fcase()` and `dplyr::case_when()`. But in that case, there _are_ ways to avoid...

new-linter