Michael Chirico

Results 727 issues of Michael Chirico

Working on #1360, I'm thinking that running `getNamespaceExports()` on every file is probably wasteful, is it worthwhile to try a simple cache approach like so? ``` linter

performance
internals

As noted in the r-devel NEWS, there are new error condition classes associated with parser errors, intended to make it easier to suss out what went wrong: https://developer.r-project.org/blosxom.cgi/R-devel/NEWS/2022/06/04 That should...

`dplyr::mutate()` allows sequential updates to variables, e.g. ``` x %>% dplyr::mutate( col = gsub("t", "", col), col = gsub("\\s+$", "xxx", col) ) ``` but `duplicate_argument_linter()` sees `col` used twice and...

`grepl("^", x)` doesn't have a strict `startsWith()` equivalent, but it _is_ quite poor usage -- `!is.na(x)` is clearly far superior. ``` x = c(NA, "", "abc") cbind( grepl = grepl("^",...

false-negative

First, we can customize the message -- the reason for inefficiency is different for the regex approach vs. the `substr()` approach (the former is similar to the `fixed=TRUE` reasoning, the...

lint-metadata

_Originally posted by @MichaelChirico in https://github.com/r-lib/lintr/pull/1311#discussion_r884201937_ My instinct is we should prefer the actionable bit up front, with explanations in the message only for clarification in cases where we can't...

lint-metadata

Follow-up split off from #575

feature
new-linter

``` lintr::lint("1:10\n", lintr::implicit_integer_linter()) # :1:2: style: Integers should not be implicit. Use the form 1L for integers or 1.0 for doubles. # 1:10 # ~^ # :1:5: style: Integers should...

feature

Here's another thing straight out of the style guide that we don't lint for, that `styler` fixes: ``` styler::style_text(" foo 1) return(x) return(x - 1) } ") # foo 1)...

feature
new-linter

I am trying to match a JSON emitter that uses a different indent than `toJSON` does by default, e.g. ``` # in /tmp/tmp.json { "array": [ { "key1": "val1", "key2":...