-
Notifications
You must be signed in to change notification settings - Fork 188
lint(text=) finds local settings again #2863
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2863 +/- ##
=======================================
Coverage 99.26% 99.26%
=======================================
Files 127 127
Lines 7092 7092
=======================================
Hits 7040 7040
Misses 52 52 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hm, I think this is having an interaction with the lack of {cyclocomp}. IINM package examples of |
I wonder if there is a better way to allow requesting the old behavior. Looking at the diff, the blast radius seems quite large. |
@@ -38,6 +38,7 @@ linters: all_linters( | |||
`<<-` = NULL | |||
)), | |||
unnecessary_concatenation_linter(allow_single_expression = FALSE), | |||
cyclocomp_linter = if (requireNamespace("cyclocomp", quietly = TRUE)) cyclocomp_linter(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This we should avoid I think. It could inadvertently disable the linter for its core purpose (linting lintr) if the dev dependencies aren't correct elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True... any ideas? The problem is that both R-CMD-check-hard
and R-CMD-check
GHA use this same config, but the former can't work without cyclocomp_linter()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was a good idea to not parse settings by default for lint(text=)
.
If we want to go back on that, maybe add a step in R-CMD-check-hard that removes our .lintr
file entirely before running?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought so too, however, I don't know how else to restore the Emacs behavior described in the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand the (7 year old) ess-lint code correctly, it gives all arguments to lint() by position.
We could soft-deprecate parsing settings if the code is pushed in via file=
instead of text=
.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the deprecation path, exactly? Would it suffice for tools like ess-lint
to explicitly supply parse_settings=TRUE
? Or such tools are required to do full-file parsing instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think explicitly requesting parse_settings = TRUE
is a good way forward.
Two comments from the outside:
|
Closes #2847, cc @bastistician
Not the biggest fan of the new
parse_settings=FALSE
usages, open to ideas about what needs to be improved here...PS, I originally pushed this directly to
main
by mistake as b548c78; reverted as dc7a612 to put this through normal review