lintr
lintr copied to clipboard
(WIP) Allows the use of = instead of <-
This is a tiny change that solves https://github.com/r-lib/lintr/issues/2441.
By adding allow_equal_assignment parameter to the assignment_linter which defaults to FALSE, we give an option to use = instead of <-.
Associated tests are passing. Some other non-associated tests are failing though. But that seems unrelated.
Potential improvements:
- perhaps a better name would be
equalityinstead ofequal? The latter might be already in use. - I modified only
xpathnottrailing_assign_xpath. Since the linter assumes<-instead of=by default, thetrailing_assign_xpathmight warrant changes as well. But this goes above my current knowledge of how linters actually work.
Review is warranted.
Thanks.
edit: Fixed issues highlighted by github actions (didn't run document() and lintr and force-pushed.
For some reason, test-lint_dir fails for me, but doesn't file on github actions:
Error (test-lint_dir.R:98:3): lint_dir works with specific linters without specifying other arguments
Error: Found unknown arguments in ...: NA.
Error (test-lint_dir.R:107:3): linting empty directory passes
Error: Found unknown arguments in ...: NA.
and lintr::lint_package() complained about not being able to read the .lintr config, but it somehow works now so I have no idea why it failed in the first place.