-
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
Error message not helpful when starts do not match ends of exclusion parts #860
Comments
could you try on the devel version of lintr? I believe this has already
been fixed
…On Thu, Sep 16, 2021, 1:33 AM Daniel Sabanes Bove ***@***.***> wrote:
Reprex:
- Put the following in test.R:
#nolint start
c(1,2)
- Run lintr:::addin_lint()
Observation:
[...]/test.R has 1 starts but only 0 ends!
Problem:
This error message is not really helpful, especially when the file is
large. It does not mention the line numbers of the start lines and that
this is about the #nolint starts and ends.
Proposal:
Give more information in the error message (line numbers, mention #nolint).
Currently the function has:
stop(file, " has ", length(starts), " starts but only ",
length(ends), " ends!")
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#860>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2BA5L32YTM46RESKLZS7DUCGTT7ANCNFSM5EEGSDUQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Thanks @MichaelChirico - just tried this with the devel version and it gives the same. So it is not yet fixed it seems. |
Could you share your new session info? I just tried myself and got the following more helpful error:
|
@MichaelChirico Yes, I now get the slightly better error message that you quote too. But that could be much better (especially for large files) if we would quote the line numbers instead of just counting the starts and ends. Would you like me to propose this in a PR? |
sure! improved error messages are always welcome |
Reprex:
test.R
:lintr:::addin_lint()
Observation:
[...]/test.R has 1 starts but only 0 ends!
Problem:
This error message is not really helpful, especially when the file is large. It does not mention the line numbers of the start lines and that this is about the
#nolint
starts and ends.Proposal:
Give more information in the error message (line numbers, mention
#nolint
). Currently the function has:Session Info:
Thanks for considering :-)
The text was updated successfully, but these errors were encountered: