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

[R] [ci] move linting code out of package #8545

Merged
merged 3 commits into from
Dec 6, 2022

Conversation

jameslamb
Copy link
Contributor

@jameslamb jameslamb commented Dec 5, 2022

Contributes to #8012.

This PR proposes the following changes to the way this project uses {lintr} to lint its R code.

  • moves the run_lint.R out of the package and up into tests/ci_build/
    • this script is only used during development, so it doesn't need to be included in the package distribution
    • doing this reduces the size of the built package on CRAN, and removes two Suggests dependencies ({lintr} and {crayon}), reducing the effort required for those other projects to test new releases
  • modifies the linting code so that .Rmd files are also checked
  • completely removes use of {crayon} in the linting code
    • this is just used to color terminal output, which I think is not worth the risk of CI builds that could be caused by failure to install that library + the added CI time to download and install it

How I tested this

Rscript ./tests/ci_build/lint_r.R "$(pwd)"

This shows 1285 linting errors, which II'm planning to propose fixes for in follow-up PRs.

Notes for Reviewers

Thanks for your time and consideration.

Copy link
Member

@trivialfis trivialfis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this! Question inlined in comments.

Also, apologies for the failing CI. GitHub action seems to be breaking down ...

R-package/tests/helper_scripts/install_deps.R Show resolved Hide resolved
@trivialfis trivialfis merged commit 05fc6f3 into dmlc:master Dec 6, 2022
@jameslamb jameslamb deleted the ci/move-lintr branch December 6, 2022 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants