-
Notifications
You must be signed in to change notification settings - Fork 186
False positive in extraction_operator_linter()
with R6
class method calls
#1485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
IMO this linter is just fundamentally problematic -- it's why we disabled it for {lintr}: Line 17 in 6d2b327
If it were up to me I'd deprecate this linter. But if you do use it, then yes, the awkward |
Is deprecating this linter an option?! Please let's do that then. This is problematic for R6, Shiny, and in so many other contexts. I haven't encountered a single codebase where I have run all linters and then decided to turn off extraction linter because it had produced so many false positives that attending to other, more relevant lints became a difficult task. |
Maybe allow all extractions that contain a call? I would also support deprecation if we don't find relevant usages in the wild. |
cc original author @fangly for whether we're missing something / he can see a good path forward for the linter. I'll also do a Mastodon post. |
FWIW, maybe codegrip will provide a convenient way to do this conversion ( |
Another common awkward case that would be handled by excluding calls: knitr::opts_chunk$set(
echo = TRUE
) That said, I've disabled this linter in our organization as well because I find the |
Ditto! I have turned off this linter in all personal repos and every organization I am part of. |
* Deprecate `extraction_operator_linter()` closes #1485 * Update NEWS.md * move it to deprecated linter file and re-document * Update NEWS.md Co-authored-by: Michael Chirico <michaelchirico4@gmail.com> * Update NEWS.md * Remove extraction_operator_linter from .lintr --------- Co-authored-by: Michael Chirico <michaelchirico4@gmail.com>
This shouldn't produce a lint:
Created on 2022-07-29 by the reprex package (v2.0.1.9000)
And, although the suggested replacement would work here, this would be an extremely unusual way of calling
R6
class methods:Created on 2022-07-29 by the reprex package (v2.0.1.9000)
The text was updated successfully, but these errors were encountered: