-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[R-package] [ci] static analysis CI job not compatible with {lintr} 3.0.0 #5228
Comments
could you elaborate on this error / what you needed to do to fix it? the deprecation warnings are expected, errors, less so -- maybe there's a back-compatibility bug we need to address. thanks for early testing!! please also file bugs if you need some finer control of the linters or if you think anything there's a new false positive. |
@MichaelChirico no problem! I'm only just starting to investigate this, and for now I just put up this issue so other maintainers here know that I'm working on it. I can give you a single early finding, but I've only been looking into this for a few minutes so I'm not saying it's an issue with The following code: library(lintr)
f <- tempfile(fileext = ".R")
writeLines("print(1)", f)
lintr::lint(
filename = f
, linters = list(
"absolute_path" = lintr::assignment_linter
)
, cache = FALSE
) Produces this error:
Changing from If that's not how you expect v3.0.0 to work, let me know and I'd be happy to open an issue over at https://github.com/r-lib/lintr/issues. |
that's definitely the right usage going forward, but I'm a bit surprised we broke you. I thought we would just warn about the non- thanks for the reprex! |
As of #5240 and #5232, there are now just 4 warnings remaining that would be raised by
|
As noticed in #5290, I'm planning to put up a PR in the next day or two to get LightGBM's CI compliant with that new version. |
@jameslamb are you working on this already? I think I can put up an initial PR. The required changes are removing the deprecated linter functions and adding the parenthesis? |
I am working on it and was planning to put up a PR tonight. Now that #5290 is done there isn't a rush. |
This issue has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
Description
This project uses
{lintr}
to catch some types of efficiency and correctness issues and to enforce standard style across all its R code.I noticed on @MichaelChirico 's Twitter tonight that a new major release of
{lintr}
will be published to CRAN soon.https://twitter.com/michael_chirico/status/1528022047502217216
I tested
{lightgbm}
with that new release tonight, and found that this project's current linting setup raises some errors and warnings with that new version. If no changes are made, once{lintr}
3.0.0 is published to CRAN, LightGBM's linting CI job will start to break.Reproducible example
Installed
{lintr}
from source on my Mac (R 4.1.0).Rscript -e "remotes::install_github('https://github.com/r-lib/lintr.git')"
Then ran this project's linting.
Rscript .ci/lint_r_code.R $(pwd)/R-package
That produced the following errors and warnings.
After modifying LightGBM's CI code to get past that error, I saw the following errors.
Also found that some of the R package's code will now fail the set of linters it's using. At first glance, these look to me like things I'd expected these linters to already catch, so they must be the benefit of bugfixes in
{lintr}
!14 new linter failures (click me)
Environment info
LightGBM version or commit hash: c000b8c
Command(s) you used to install LightGBM
Additional Comments
Full list of changes in
{lintr}
3.0.0: https://github.com/r-lib/lintr/blob/master/NEWS.mdThe text was updated successfully, but these errors were encountered: