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

Related: #2252 Copied out from TODO: ``` # TODO support more glue functions # Package glue: # - glue_sql # - glue_safe # - glue_col # - glue_data # -...

feature
object linters 🏀

Found in data.table, e.g. https://github.com/Rdatatable/data.table/blob/3bd4fd16395b015fcb8f72db54948f7cc5562710/R/bmerge.R#L134-L137 ```r lint(linters = unnecessary_nested_if_linter(), text = " if (isTRUE(getOption('datatable.use.index'))) { xo = getindex(x, names(x)[xcols]) if (verbose && !is.null(xo)) catf('on= matches existing index, using index\n') }...

false-positive

Currently, we don't have a way for enforcing a style guide rule other than `

feature

Leaving the argument "blank" like `x[ , j, by]` is a stylistic choice to emphasize the absence of the argument; it's visually harder to parse `x[, j, by]` as it's...

feature

@MichaelChirico is this recommending you use `map_vec(x, foo, y = y)` instead? We actually recommend using the anonymous function form rather than using `...` to pass named arguments through to...

feature

Similar to https://github.com/r-lib/styler/pull/1138, I think that `import-standalone*` should not be linted by default. As they are supposed to be read-only, they should only be linted in their original repo where...

feature

```r nrow(DT[(conds)]) # but NOT DT[conds, .N] # or DT[conds, .(.N)] # or nrow(DT[conds]) # or DT[conds, .(.N), by = by] # or nrow(DT[conds, j, by = by]) ``` Generally...

false-negative

Follow-up to #2349; there's some discussion there of how to proceed. Split this off to isolate the general tracking of a robust solution here from the much simpler issue of...

automation :robot:

E.g., a generalized version of such linter can also cover the following common mistakes: ``` r library(lintr) x [1] NA is.nan(x) # proposed alternative in lint message #> [1] TRUE...

feature