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

Rename of default= to defaults= is hard to debug (linters_with_defaults) #1336

Closed
MichaelChirico opened this issue May 31, 2022 · 1 comment · Fixed by #1339
Closed

Rename of default= to defaults= is hard to debug (linters_with_defaults) #1336

MichaelChirico opened this issue May 31, 2022 · 1 comment · Fixed by #1339
Assignees
Milestone

Comments

@MichaelChirico
Copy link
Collaborator

MichaelChirico commented May 31, 2022

Just discovered this hard-to-debug issue:

# pre-3.0.0 usage
my_linters <- with_defaults(default = list(), no_tab_linter())
writeLines(names(my_linters))
# no_tab_linter

OK, we get a warning:

Warning message: Function with_defaults was deprecated in lintr version 2.0.9001. Use linters_with_defaults instead.

So we switch:

my_linters <- linters_with_defaults(default = list(), no_tab_linter())
writeLines(names(my_linters))
# assignment_linter
# ...
# default
# ...
# vector_logic_linter

i.e., default= is taken as part of the ... arguments, and we don't start from a blank (list()) override.

Probably we should allow default= to work in linters_with_defaults(), with warning.

(Or perhaps this pluralization was an oversight?)

@MichaelChirico MichaelChirico added this to the 3.0.0 milestone May 31, 2022
@AshesITR
Copy link
Collaborator

The renaming was deliberate, but "default" is unlikely to be a name for a linter so we can add a safety net.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants