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

GH-43979: [CI][C++][Dev] Add cpplint to pre-commit #43982

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

kou
Copy link
Member

@kou kou commented Sep 6, 2024

Rationale for this change

cpplint isn't integrated with pre-commit yet.

What changes are included in this PR?

  • Add cpplint configuration
  • Share configuration with pre-commit and cpp/build-support/run_cpplint.py
  • Add pre-commit entry

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

@kou kou requested a review from raulcd as a code owner September 6, 2024 05:35
Copy link

github-actions bot commented Sep 6, 2024

⚠️ GitHub issue #43979 has been automatically assigned in GitHub to PR creator.

^cpp/
exclude: >-
(
?\.grpc\.fb\.(cc|h)$|
Copy link
Member

Choose a reason for hiding this comment

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

The only nit is that this does not match the exclusion list that we have today in: https://github.com/apache/arrow/blob/main/cpp/build-support/lint_exclusions.txt
I can see some pyarrow files there. We can merge this PR and add a follow up issue to add C++ linting to pre-commit to python and R (which seems to be what was originally linted)

Copy link
Member Author

@kou kou Sep 6, 2024

Choose a reason for hiding this comment

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

Good catch! I missed the file.
It seems that *windows_compatibility.h difference is only affected for cpp/.
But we can use cpplint for *windows_compatibility.h` now:

So this list is valid.

I also missed that R also uses cpplint: https://github.com/apache/arrow/blob/main/r/lint.sh
Let's work on it as a separated PR.

It seems that the current Python code base doesn't use cpplint.

BTW, I doubt that we need cpplint: #37396

Copy link
Member

@raulcd raulcd left a comment

Choose a reason for hiding this comment

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

LGTM just a nit that we can add as a follow up

@github-actions github-actions bot added awaiting changes Awaiting changes awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review awaiting changes Awaiting changes awaiting merge Awaiting merge labels Sep 6, 2024
@raulcd raulcd merged commit 089ad78 into apache:main Sep 6, 2024
37 of 38 checks passed
@raulcd raulcd removed the awaiting changes Awaiting changes label Sep 6, 2024
@raulcd
Copy link
Member

raulcd commented Sep 6, 2024

I've added #43987 as a follow up issue (that we might want to do or not).

Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 089ad78.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 4 possible false positives for unstable benchmarks that are known to sometimes produce them.

@kou kou deleted the ci-cpplint branch September 6, 2024 20:39
khwilson pushed a commit to khwilson/arrow that referenced this pull request Sep 14, 2024
### Rationale for this change

cpplint isn't integrated with pre-commit yet.

### What changes are included in this PR?

* Add cpplint configuration
* Share configuration with pre-commit and cpp/build-support/run_cpplint.py
* Add pre-commit entry

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* GitHub Issue: apache#43979

Authored-by: Sutou Kouhei <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants