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

Refactor with_defaults() #1029

Closed
AshesITR opened this issue Mar 29, 2022 · 2 comments · Fixed by #1117
Closed

Refactor with_defaults() #1029

AshesITR opened this issue Mar 29, 2022 · 2 comments · Fixed by #1117
Milestone

Comments

@AshesITR
Copy link
Collaborator

AshesITR commented Mar 29, 2022

lintr/R/zzz.R

Line 65 in b4747a3

if (inherits(x, "function") && !inherits(x, "lintr_function")) {

let's use is.function(x) instead?

f = lm
class(f) = 'boo'
inherits(f, 'function')
# [1] FALSE
is.function(f)
# [1] TRUE

Originally posted by @MichaelChirico in #1015 (comment)

@AshesITR
Copy link
Collaborator Author

Thoughts on this:

  • The new preferred way of configuring lintr should be linters_with_tags(), which, without arguments, yields results equivalent to with_defaults() without a default = argument, as is used in .lintr files. (tags= argument for available_linters() #980)
  • with_defaults() must not break immediately, but should be deprecated in favor of linters_with_tags()
  • A better name for what with_defaults() does is modify_defaults().

@AshesITR
Copy link
Collaborator Author

AshesITR commented May 2, 2022

In view of the fact that we might add google_linters as a pre-configured object, we'll still need something like with_defaults(), so I will deprecate-rename to linters_with_defaults(..., default = default_linters) instead

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.

1 participant