-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-46528: [CI][Dev] Remove "archery lint" #46686
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
Conversation
ci/scripts/install_iwyu.sh
Outdated
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.
We'll revisit IWYU in the future.
It's tracked by #46543 .
cpp/build-support/run_clang_tidy.py
Outdated
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.
We'll revisit clang-tidy in the future.
It's tracked by #46542 .
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.
pre-commit installs pined clang-format automatically.
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 ID is added in this PR.
r/vignettes/developers/workflow.Rmd
Outdated
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.
We'll use Air in the future.
It's tracked by #46592 .
raulcd
left a comment
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.
Should we remove these bits from the LICENSE and NOTICE files about cpplint code?
Lines 784 to 793 in acbad29
| -------------------------------------------------------------------------------- | |
| This project includes code from the Google styleguide. | |
| * cpp/build-support/cpplint.py is based on the scripts from the Google styleguide. | |
| Copyright: 2009 Google Inc. All rights reserved. | |
| Homepage: https://github.com/google/styleguide | |
| License: 3-clause BSD | |
Lines 20 to 21 in acbad29
| This product includes software from the google-lint project | |
| * Copyright (c) 2009 Google Inc. All rights reserved. |
|
Good catch! We should remove them. I'll do it. |
raulcd
left a comment
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 seems good to me, I haven't used archery lint lately since we've been adding more linters to pre-commit. @pitrou any concern here?
I've double checked numpydoc have it's own separate archery command.
|
That's fine with me. @kszucs Any comments? |
r/vignettes/developers/workflow.Rmd
Outdated
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.
Thanks for making this all a lot more concise!
We should leave in information about how to run it other than with pre-commit. Many R users are more comfortable with running lintr directly as it's much simpler (I've personally had issues getting pre-commit set up so won't be the only one), so it'd be great to give them both options.
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.
OK.
Is it OK that running r/tools/lint.R for non pre-commit option? R developers need to install lintr manually with this approach.
(Can we remove ci/docker/linux-apt-lint.dockerfile? I want to remove ci/docker/linux-apt-lint.dockerfile.)
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.
Or is running lintr::lint_package("arrow/r") directly better?
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.
Running lintr::lint_package("arrow/r") is better for a non-pre-commit option, yes. arrow/r/lint.R could possibly be removed once it's unhooked from CI. The average R contributor will probably run lintr::lint_package to lint and the core dev team generally runs arrow/r/lint.sh to lint R and C++ at the same time.
I'm not sure we can remove linux-apt-lint.dockerfile just yet. IIRC the way that's set up, it will catch lints in the R packages internal C++ code but the current r.yml workflow just lints the R code so removing linux-apt-lint.dockerfile could cause us to merge R C++ code with lint issues. I think we could modify the R workflow to keep the functionality though. Happy to work on that.
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.
OK. Let's use lintr::lint_package("arrow/r").
the core dev team generally runs
arrow/r/lint.shto lint R and C++ at the same time.
Hmm... This PR removes r/lint.sh...
Could you share pre-commit related issues you got? Can we fix them instead of avoiding pre-commit?
I'm not sure we can remove linux-apt-lint.dockerfile just yet. IIRC the way that's set up, it will catch lints in the R packages internal C++ code but the current
r.ymlworkflow just lints the R code so removing linux-apt-lint.dockerfile could cause us to merge R C++ code with lint issues. I think we could modify the R workflow to keep the functionality though.
Oh, I missed that the r.yml workflow also runs lintr:
Lines 334 to 351 in b630f48
| - name: Run lintr | |
| if: ${{ matrix.config.rversion == 'release' }} | |
| env: | |
| NOT_CRAN: "true" | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| shell: Rscript {0} | |
| working-directory: r | |
| run: | | |
| Sys.setenv( | |
| RWINLIB_LOCAL = file.path(Sys.getenv("GITHUB_WORKSPACE"), "r", "windows", "libarrow.zip"), | |
| MAKEFLAGS = paste0("-j", parallel::detectCores()), | |
| ARROW_R_DEV = TRUE, | |
| "_R_CHECK_FORCE_SUGGESTS_" = FALSE | |
| ) | |
| # we use pak for package installation since it is faster, safer and more convenient | |
| pak::local_install() | |
| pak::pak("lintr") | |
| lintr::expect_lint_free() |
(BTW, I didn't know that lintr::expect_lint_free() exists. I changed the pre-commit configuration to use lintr::expect_lint_free() and removes r/tools/lint.R.)
I want to remove the "Run lintr" step too because it's already done by pre-commit
arrow/.github/workflows/dev.yml
Lines 66 to 68 in b630f48
| - name: Run pre-commit | |
| run: | | |
| pre-commit run --all-files --color=always --show-diff-on-failure |
archery lint arrow/.github/workflows/dev.yml
Lines 71 to 78 in b630f48
| - name: Execute Docker Build | |
| env: | |
| ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} | |
| ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} | |
| UBUNTU: 22.04 | |
| run: | | |
| source ci/scripts/util_enable_core_dumps.sh | |
| archery docker run -e GITHUB_ACTIONS=true ubuntu-lint |
And pre-commit and archery lint check not only R code but also R C++ code. So we will not merge R C++ code with lint issues.
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.
Thanks. You're using Ubuntu 22.04, right?
How about the following?
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index c3835ac0f1..e3e8abdeed 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -356,7 +356,10 @@ repos:
?^swift/gen-protobuffers\.sh$|
)
- repo: https://github.com/scop/pre-commit-shfmt
- rev: v3.11.0-1
+ # v3.11.0-1 or later requires pre-commit 3.2.0 or later but Ubuntu
+ # 22.04 ships pre-commit 2.17.0. We can use update this rev after
+ # Ubuntu 22.04 reached EOL (June 2027).
+ rev: v3.10.0-1
hooks:
- id: shfmt
alias: shellI've opened #46798 for this.
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.
FYI: You can use pre-commit run --all-files r only for R as described in the changed document.
In the case, shfmt isn't used. So the error isn't occurred.
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.
#46799 will fix this.
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 feel like I did get some error when I ran the full command but can't recall now as I've just updated pre-commit. Thanks @kou! :)
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.
OK. I'll merge this.
|
We have duplicated most of the linters in both archery and pre-commit hooks also causing version and configuration mismatches for certain tools, so I strongly support this change. |
We can use pre-commit instead of "archery lint".
Co-authored-by: Bryce Mecum <[email protected]>
69ef60a to
478eb89
Compare
|
I'll merge this in a few days if nobody objects it. |
|
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit c314e80. There were 73 benchmark results with an error:
There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them. |
### Rationale for this change We can use pre-commit instead of "archery lint" for all linters/formatters. ### What changes are included in this PR? * Remove "archery lint" CI job * Remove "archery lint" related codes including IWYU and clang-tidy because IWYU and clang-tidy aren't used for now * Remove "archery lint" related docs including IWYU and clang-tidy related docs ### Are these changes tested? Yes. ### Are there any user-facing changes? No. It's only affected to developers. * GitHub Issue: apache#46528 Lead-authored-by: Sutou Kouhei <[email protected]> Co-authored-by: Sutou Kouhei <[email protected]> Co-authored-by: Bryce Mecum <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
Rationale for this change
We can use pre-commit instead of "archery lint" for all linters/formatters.
What changes are included in this PR?
Are these changes tested?
Yes.
Are there any user-facing changes?
No.
It's only affected to developers.