-
Notifications
You must be signed in to change notification settings - Fork 184
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
Feature request: include linter name in warnings #1357
Comments
thanks for filing! indeed the though has crossed my mind a few times but I always forgot to file an issue. v. important to be able to understand at a glance how to suppress each lint now that we have targeted suppression available |
That's a very reasonable request. So far, I've used We should also think about other output methods, e.g. GHA comments and RStudio Source Markers |
I think for interactive use, as.data.frame() suffices, but not available when running as a plugin or in CI. easiest to just part of print.lints |
Yep. Note GHA markers aren't made directly by print.lints IIRC. |
thanks so much @AshesITR !! |
Thank you for the suggestion! |
Request
Consider the following code:
On
{lintr}
2.0.1 installed from CRAN and on the latest version from GitHub (801fac3, installed withremotes::install_github("r-lib/lintr")
), this produces the following output (the(...)
is mine, just to make the path a bit more readable):As a user of
{lintr}
, I'd like to see the linter name printed in the output, like this:Motivation
I learned tonight from @MichaelChirico that as of
{lintr}
3.0.0, it'll be possible to use a comment like the following to say "ignore warnings from a specific linter on this line" (microsoft/LightGBM#5249 (comment)).I totally see the value in being specific there and would like to do that. But since the linter name isn't printed in the warnings from
lintr::lint()
, figuring out the right value to add in that comment will require some trial-and-error or searching in this package's source code.References:
As an example,
flake8
also supports such targeted comments (https://flake8.pycqa.org/en/3.1.1/user/ignoring-errors.html#in-line-ignoring-errors), and I've found it really helpful that it prints in its output exactly the code that should be added to# noqa
comments.Example suppressing one specific warning:
Thanks for your time and consideration!
The text was updated successfully, but these errors were encountered: