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-41688: [Dev] Include all relevant CMakeLists.txt files in cmake-format precommit hook #41689

Merged

Conversation

jorisvandenbossche
Copy link
Member

@jorisvandenbossche jorisvandenbossche commented May 16, 2024

Rationale for this change

Some CMakeLists.txt files are not included in the pre-commit hook (causing failures on CI through archery if you rely on the pre-commit hook locally)

What changes are included in this PR?

Include all CMakeLists.txt files by default anywhere in the repo, and explicitly exclude the ones we don't want (vendored files).

In practice, compared to the current set of files covered by the hook, those new files are included in the search:

'cpp/CMakeLists.txt',
'java/CMakeLists.txt',
'matlab/CMakeLists.txt',
'python/CMakeLists.txt'

Are these changes tested?

Yes

Copy link

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

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.

Not an expert on those regex but the change LGTM

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels May 16, 2024
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

Comment on lines 126 to 130
?^cpp/cmake_modules/FindNumPy\.cmake$|
?^cpp/cmake_modules/FindPythonLibsNew\.cmake$|
?^cpp/cmake_modules/UseCython\.cmake$|
?^cpp/src/arrow/util/config\.h\.cmake$|
?^ci/conan/all/.*CMakeLists\.txt$|
Copy link
Member

Choose a reason for hiding this comment

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

Could you sort this list in alphabetical order?

Suggested change
?^cpp/cmake_modules/FindNumPy\.cmake$|
?^cpp/cmake_modules/FindPythonLibsNew\.cmake$|
?^cpp/cmake_modules/UseCython\.cmake$|
?^cpp/src/arrow/util/config\.h\.cmake$|
?^ci/conan/all/.*CMakeLists\.txt$|
?^ci/conan/all/.*CMakeLists\.txt$|
?^cpp/cmake_modules/FindNumPy\.cmake$|
?^cpp/cmake_modules/FindPythonLibsNew\.cmake$|
?^cpp/cmake_modules/UseCython\.cmake$|
?^cpp/src/arrow/util/config\.h\.cmake$|

Comment on lines 119 to 122
?^ci/.*/.*\.cmake$|
?^cpp/.*/.*\.cmake\.in$|
?^cpp/.*/.*\.cmake$|
?^cpp/.*/CMakeLists\.txt$|
?^go/.*/CMakeLists\.txt$|
?^java/.*/CMakeLists\.txt$|
?^matlab/.*/CMakeLists\.txt$|
?^python/.*/CMakeLists\.txt$|
?.*CMakeLists\.txt$|
Copy link
Member

Choose a reason for hiding this comment

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

Could you sort this list in alphabetical order?

          ?.*CMakeLists\.txt$|
          ?^ci/.*/.*\.cmake$|
          ?^cpp/.*/.*\.cmake\.in$|
          ?^cpp/.*/.*\.cmake$|

@jorisvandenbossche jorisvandenbossche merged commit 14b8ca5 into apache:main May 17, 2024
7 checks passed
@jorisvandenbossche jorisvandenbossche removed the awaiting merge Awaiting merge label May 17, 2024
@jorisvandenbossche jorisvandenbossche deleted the cmake-format-pre-commit branch May 17, 2024 12:35
Copy link

After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit 14b8ca5.

There was 1 benchmark result indicating a performance regression:

The full Conbench report has more details.

vibhatha pushed a commit to vibhatha/arrow that referenced this pull request May 25, 2024
…ake-format precommit hook (apache#41689)

### Rationale for this change

Some CMakeLists.txt files are not included in the pre-commit hook (causing failures on CI through archery if you rely on the pre-commit hook locally)

### What changes are included in this PR?

Include all CMakeLists.txt files by default anywhere in the repo, and explicitly exclude the ones we don't want (vendored files).

In practice, compared to the current set of files covered by the hook, those new files are included in the search:

'cpp/CMakeLists.txt',
'java/CMakeLists.txt',
'matlab/CMakeLists.txt',
'python/CMakeLists.txt'

### Are these changes tested?

Yes
* GitHub Issue: apache#41688

Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
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.

None yet

3 participants