Skip to content
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

with_defaults() appears to mangle the class attribute lintr_function #511

Closed
stufield opened this issue Aug 17, 2020 · 0 comments · Fixed by #612
Closed

with_defaults() appears to mangle the class attribute lintr_function #511

stufield opened this issue Aug 17, 2020 · 0 comments · Fixed by #612
Labels
bug an unexpected problem or unintended behavior

Comments

@stufield
Copy link
Collaborator

When using lintr::with_defaults() to either modify or remove specific linters, the class attribute of the returned linter functions appear duplicated. Usually would not result in a bug, but does not seem right (lintr v2.0.1 CRAN).

> purrr::map(default_linters[1:2], class)
$assignment_linter
[1] "function"       "lintr_function"

$closed_curly_linter
[1] "function"       "lintr_function"

# use `with_defaults()`
> foo <- with_defaults(default = default_linters[1:2])
> purrr::map(foo, class)
$assignment_linter
[1] "function"       "lintr_function" "lintr_function"

$closed_curly_linter
[1] "function"       "lintr_function" "lintr_function"
@stufield stufield added the bug an unexpected problem or unintended behavior label Aug 17, 2020
AshesITR added a commit that referenced this issue Nov 28, 2020
delint zzz.R and remove unnecessary # nolint in the same file

also fix the minor issue #511 while touching zzz.R

fixes #517 and #511
@AshesITR AshesITR linked a pull request Nov 28, 2020 that will close this issue
MichaelChirico added a commit that referenced this issue Dec 2, 2020
* add T_and_F_symbol_linter to default_linters

delint zzz.R and remove unnecessary # nolint in the same file

also fix the minor issue #511 while touching zzz.R

fixes #517 and #511

* update NEWS.md

* add T/F symbol to default_linter_testcode.R

* add info comment

* restore line_length lint and no_tab

* sync all versions of default_linter_testcode.R

* Restore trailing whitespace

A proper IDE makes this nigh impossible to produce :D

* Update default_linter_testcode.R

* Update default_linter_testcode.R

* Update default_linter_testcode.R

* fix T_and_F lint in addins.R

* # nocov RStudio addins

* remove unused function named_list, # nocov .onLoad

Co-authored-by: Michael Chirico <michaelchirico4@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant