Skip to content

GH-41688: [Dev] Include all relevant CMakeLists.txt files in cmake-format precommit hook#41689

Merged
jorisvandenbossche merged 2 commits intoapache:mainfrom
jorisvandenbossche:cmake-format-pre-commit
May 17, 2024
Merged

GH-41688: [Dev] Include all relevant CMakeLists.txt files in cmake-format precommit hook#41689
jorisvandenbossche merged 2 commits intoapache:mainfrom
jorisvandenbossche:cmake-format-pre-commit

Conversation

@jorisvandenbossche
Copy link
Copy Markdown
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

@github-actions
Copy link
Copy Markdown

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

Copy link
Copy Markdown
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
Copy Markdown
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/FindPythonLibsNew\.cmake$|
?^cpp/cmake_modules/UseCython\.cmake$|
?^cpp/src/arrow/util/config\.h\.cmake$|
?^ci/conan/all/.*CMakeLists\.txt$|
Copy link
Copy Markdown
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
Copy Markdown
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$|

@conbench-apache-arrow
Copy link
Copy Markdown

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.

3 participants