You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kou (via GitHub)" <gi...@apache.org> on 2024/09/06 05:35:22 UTC

[PR] GH-43979: [CI][C++][Dev] Add cpplint to pre-commit [arrow]

kou opened a new pull request, #43982:
URL: https://github.com/apache/arrow/pull/43982

   ### 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-43979: [CI][C++][Dev] Add cpplint to pre-commit [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #43982:
URL: https://github.com/apache/arrow/pull/43982#discussion_r1746791982


##########
.pre-commit-config.yaml:
##########
@@ -78,6 +78,26 @@ repos:
           ?^cpp/src/generated/|
           ?^cpp/thirdparty/|
           )
+  - repo: https://github.com/cpplint/cpplint
+    rev: 1.6.1
+    hooks:
+      - id: cpplint
+        name: C++ Lint
+        args:
+          - "--verbose=2"
+        types_or:
+          - c++
+        files: >-
+          ^cpp/
+        exclude: >-
+          (
+          ?\.grpc\.fb\.(cc|h)$|

Review Comment:
   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:
   
   * https://github.com/apache/arrow/blob/main/cpp/src/arrow/util/windows_compatibility.h
   * https://github.com/apache/arrow/blob/main/cpp/src/parquet/windows_compatibility.h
   
   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 may not need cpplint: https://github.com/apache/arrow/issues/37396



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-43979: [CI][C++][Dev] Add cpplint to pre-commit [arrow]

Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd merged PR #43982:
URL: https://github.com/apache/arrow/pull/43982


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-43979: [CI][C++][Dev] Add cpplint to pre-commit [arrow]

Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #43982:
URL: https://github.com/apache/arrow/pull/43982#issuecomment-2334597298

   After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 089ad788976041444887a9a9c3b8f6973467e22a.
   
   There were no benchmark performance regressions. 🎉
   
   The [full Conbench report](https://github.com/apache/arrow/runs/29797783572) has more details. It also includes information about 4 possible false positives for unstable benchmarks that are known to sometimes produce them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-43979: [CI][C++][Dev] Add cpplint to pre-commit [arrow]

Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on code in PR #43982:
URL: https://github.com/apache/arrow/pull/43982#discussion_r1746711318


##########
.pre-commit-config.yaml:
##########
@@ -78,6 +78,26 @@ repos:
           ?^cpp/src/generated/|
           ?^cpp/thirdparty/|
           )
+  - repo: https://github.com/cpplint/cpplint
+    rev: 1.6.1
+    hooks:
+      - id: cpplint
+        name: C++ Lint
+        args:
+          - "--verbose=2"
+        types_or:
+          - c++
+        files: >-
+          ^cpp/
+        exclude: >-
+          (
+          ?\.grpc\.fb\.(cc|h)$|

Review Comment:
   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)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-43979: [CI][C++][Dev] Add cpplint to pre-commit [arrow]

Posted by "raulcd (via GitHub)" <gi...@apache.org>.
raulcd commented on PR #43982:
URL: https://github.com/apache/arrow/pull/43982#issuecomment-2333748185

   I've added https://github.com/apache/arrow/issues/43987 as a follow up issue (that we might want to do or not).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-43979: [CI][C++][Dev] Add cpplint to pre-commit [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #43982:
URL: https://github.com/apache/arrow/pull/43982#issuecomment-2333267494

   :warning: GitHub issue #43979 **has been automatically assigned in GitHub** to PR creator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] GH-43979: [CI][C++][Dev] Add cpplint to pre-commit [arrow]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #43982:
URL: https://github.com/apache/arrow/pull/43982#discussion_r1746791982


##########
.pre-commit-config.yaml:
##########
@@ -78,6 +78,26 @@ repos:
           ?^cpp/src/generated/|
           ?^cpp/thirdparty/|
           )
+  - repo: https://github.com/cpplint/cpplint
+    rev: 1.6.1
+    hooks:
+      - id: cpplint
+        name: C++ Lint
+        args:
+          - "--verbose=2"
+        types_or:
+          - c++
+        files: >-
+          ^cpp/
+        exclude: >-
+          (
+          ?\.grpc\.fb\.(cc|h)$|

Review Comment:
   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:
   
   * https://github.com/apache/arrow/blob/main/cpp/src/arrow/util/windows_compatibility.h
   * https://github.com/apache/arrow/blob/main/cpp/src/parquet/windows_compatibility.h
   
   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: https://github.com/apache/arrow/issues/37396



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org