-
Notifications
You must be signed in to change notification settings - Fork 93
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
Use lint text if supported #284
Conversation
LGTM except you might need to |
Since r-lib/lintr#503 is merged, we could wait for the latest lintr (probably 3.0.0) to be released, then we could import |
@randy3k Since we have support for both old lintr (current release) and latest lintr with |
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 am a bit hesitated to merge it. With that say, I guess it is an acceptable solution for now, just need to put a note here to remind ourselves in the future.
The tests only work with latest lintr rather than the current CRAN release. I guess we should postpone this PR until lintr 3.0.0 is released and then we could directly import lintr 3.0.0 and do not have to detect Or after this languageserver release, we could put back |
I guess we could merge this PR into master now. The development version of |
R/diagnostics.R
Outdated
# In the upcoming lintr 3.0.0, lint(text=) is supported so that | ||
# we could supply both filename and text and the text will be | ||
# regarded as the content of the file. | ||
lint_text_support <- "text" %in% names(formals(lintr::lint)) |
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.
Do we still need this for the version of lintr specified in DESCRIPTION?
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.
Now we could safely assume lintr(text=)
. I'll remove those checking.
LGTM |
I just realized that there is no roadmap for the release of new version of |
Close #80
Close #235
Close #238
Close #282
r-lib/lintr#503 adds a
text=
argument tolintr::lint
to make it easier for code editors to lint a text as if it is from a filename so that lint config is kept effective.