You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[feature request] generate a ".lintr" file function #902
New users who are not familiar with the DCF format will have a hard time trying to set up a .lintr file.
I think it would be useful to have a function to generate a basic .lintr file.
That sounds like a nice idea, thanks for the suggestion!
I wonder whether usethis would be a good place to put this (e.g. usethis::use_lintr()).
If they're not interested, we could provide it ourselves too, though.
The main motivation for setting up this file is to make the length of one line 120.
So I imagined it would be useful to output a file with all the default settings written to it, such that this could be accomplished by simply editing 80 to 120.
Of course, if all configuration items are output, it would be too much, so it would be nice to be able to filter the output items with an argument such as type="full" like you did in #1120.
Dumping all default arguments seems rather advanced. Outputting all default linters would amount to 24 lines of code at the moment and outputting all linters (the equivalent of linters_with_tags(tags = NULL)) would mean 69 lines.
What do you think about adding a (static) comment that exemplifies the three possible actions (add a linter, reconfigure a linter, remove a linter)?
I thought it was wonderful that comments like the following were included in the file, which worked well with R's excellent help functionality.
exclusions: list("renv", "packrat") # see ?exclude
However, users may not have loaded lintr, so a comment like see ?lintr::exclude would be more clear, I think.
I thought it would be useful too to add a link to the vignette (maybe vignette("using_lintr") ?) that will be added in lintr 3.0.0 on how to edit .lintr files.
Activity
AshesITR commentedon Feb 5, 2022
That sounds like a nice idea, thanks for the suggestion!
I wonder whether
usethiswould be a good place to put this (e.g.usethis::use_lintr()).If they're not interested, we could provide it ourselves too, though.
AshesITR commentedon May 2, 2022
@eitsupi Can you take a look at #1120 and see if
use_lintr()would help you? Thanks for your feedback!eitsupi commentedon May 2, 2022
@AshesITR Thanks for letting me know!
However, it was a little different from what I had imagined.
For example, I usually set up a file like the following:
The main motivation for setting up this file is to make the length of one line 120.
So I imagined it would be useful to output a file with all the default settings written to it, such that this could be accomplished by simply editing 80 to 120.
Of course, if all configuration items are output, it would be too much, so it would be nice to be able to filter the output items with an argument such as
type="full"like you did in #1120.AshesITR commentedon May 2, 2022
Thanks for your swift feedback.
Dumping all default arguments seems rather advanced. Outputting all default linters would amount to 24 lines of code at the moment and outputting all linters (the equivalent of
linters_with_tags(tags = NULL)) would mean 69 lines.What do you think about adding a (static) comment that exemplifies the three possible actions (add a linter, reconfigure a linter, remove a linter)?
eitsupi commentedon May 2, 2022
I thought it was wonderful that comments like the following were included in the file, which worked well with R's excellent help functionality.
However, users may not have loaded lintr, so a comment like
see ?lintr::excludewould be more clear, I think.I thought it would be useful too to add a link to the vignette (maybe
vignette("using_lintr")?) that will be added in lintr 3.0.0 on how to edit.lintrfiles.eitsupi commentedon May 18, 2022
closed by fff7808