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

Add config_file = argument to lint() & co. #1177

Open
AshesITR opened this issue May 22, 2022 · 5 comments
Open

Add config_file = argument to lint() & co. #1177

AshesITR opened this issue May 22, 2022 · 5 comments
Labels
config feature a feature request or enhancement

Comments

@AshesITR
Copy link
Collaborator

Would be more convenient than withr::with_options(c("lintr.linter_file" = my_new_config), lintr::lint_package()) when prepairing a config switch.

@MichaelChirico MichaelChirico added feature a feature request or enhancement config labels Oct 13, 2022
@MichaelChirico
Copy link
Collaborator

WDYT about re-using parse_settings for this?

lint_package(parse_settings = my_new_config)

@AshesITR
Copy link
Collaborator Author

AshesITR commented Feb 19, 2025

Good idea WDYT about renaming to config = NULL and accepting:

  1. NULL or TRUE for auto-discovery
  2. NA or FALSE for parse_settings = FALSE
  3. A string path to a .lintr or .lintr.R
  4. A list containing a constructed config

Of course we would need a deprecation cycle and some way to detect DCF vs. R.

@MichaelChirico
Copy link
Collaborator

I'm not personally a fan of requiring people to distinguish NULL from NA, it always feels a bit arbitrary. E.g. I'd assume NULL --> "nothing" --> "no config", vs. NA --> "missing" --> ?not sure

Besides that the idea sounds good initially. I would use config = "auto" the default for auto-discovery. We could also let config = "path/to/dir" where the directory is searched for .lintr / .lintr.R as today.

@MichaelChirico
Copy link
Collaborator

Related: #1515

@AshesITR
Copy link
Collaborator Author

The issue with "auto" is a surprising edge case four the user if the desired config is located in a directory with name "auto".

Using NULL as not specified / default seems less surprising to me.
I agree we shouldn't act on NA though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants