Skip to content
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

[ci] [R-package] upgrade to lintr v3.0 (fixes #5228) #5294

Merged
merged 1 commit into from
Jun 16, 2022
Merged

Conversation

jameslamb
Copy link
Collaborator

Fixes #5228.
Reverts #5290.

{lintr} v3.0.0 was released to CRAN a few days ago (https://cran.r-project.org/web/packages/lintr/index.html). This PR proposes updates to the lint CI job to make LightGBM's CI compatible with that new version.

Changes in this PR

Converts linters to function calls instead of function references (see #5228 (comment) for background).

Replaces some linters to resolve the following warnings.

Warning messages:
1: Linter closed_curly_linter was deprecated in lintr version 3.0.0. Use brace_linter instead.
2: Linter open_curly_linter was deprecated in lintr version 3.0.0. Use brace_linter instead.
3: Linter paren_brace_linter was deprecated in lintr version 3.0.0. Use brace_linter instead.
4: Linter semicolon_terminator_linter was deprecated in lintr version 3.0.0. Use semicolon_linter instead.

Makes minor changes to resolve the following linting errors.

[[1]]
.ci/lint_r_code.R:59:29: warning: [non_portable_path] Use file.path() to construct portable file paths.
            , "dyn.load" = "Directly loading/unloading .dll/.so files in package code should not be necessary."
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[[2]]
.ci/lint_r_code.R:60:31: warning: [non_portable_path] Use file.path() to construct portable file paths.
            , "dyn.unload" = "Directly loading/unloading .dll/.so files in package code should not be necessary."
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[[3]]
build_r.R:27:20: warning: [non_portable_path] Use file.path() to construct portable file paths.
    if (any(grepl("^\\-j[0-9]+", arg))) {
                   ^~~~~~~~~~~

Notes for Reviewers

There are some NEW linters available in {lintr} v3.0.0, and maybe this project should consider them. But I decided not to investigate that here, and limit this PR's scope to "get LightGBM's linting job working with the latest {lintr}".

I'd also like to say a special thanks to @MichaelChirico for giving us so much advance warning of this new release via Twitter, and for all the help on #5228 and related conversations here and in https://github.com/r-lib/lintr.

@github-actions
Copy link

This pull request 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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[R-package] [ci] static analysis CI job not compatible with {lintr} 3.0.0
2 participants