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

Use upstream clang-format pre-commit hook. #10659

Merged
merged 2 commits into from
Apr 25, 2022

Conversation

bdice
Copy link
Contributor

@bdice bdice commented Apr 14, 2022

This PR improves the use of clang-format in pre-commit and CI by using a hook that is managed and cached by pre-commit. Developers who do not use pre-commit will see no changes to their workflow. Developers using pre-commit will be guaranteed that their code is formatted with the pinned version of clang-format (and will always align with CI's style check expectations) even if they have a different version of clang-format (or no version of clang-format) installed on their path. Like all pre-commit hooks for linting CMake and Python code, this version pinning will need to be kept in sync with the conda environment if we choose to upgrade clang-format.

Note: this is aligned with how cuCollections uses clang-format, and it seems that has gone well. Thanks to @PointKernel for testing it on that repo!
https://github.com/NVIDIA/cuCollections/blob/dev/.pre-commit-config.yaml

@bdice bdice self-assigned this Apr 14, 2022
@bdice bdice added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Apr 14, 2022
@codecov
Copy link

codecov bot commented Apr 14, 2022

Codecov Report

Merging #10659 (8835532) into branch-22.06 (3c13ef1) will increase coverage by 0.02%.
The diff coverage is 89.52%.

@@               Coverage Diff                @@
##           branch-22.06   #10659      +/-   ##
================================================
+ Coverage         86.33%   86.36%   +0.02%     
================================================
  Files               140      142       +2     
  Lines             22289    22352      +63     
================================================
+ Hits              19244    19305      +61     
- Misses             3045     3047       +2     
Impacted Files Coverage Δ
python/cudf/cudf/core/algorithms.py 90.47% <ø> (ø)
python/cudf/cudf/core/groupby/groupby.py 91.72% <ø> (+0.22%) ⬆️
python/cudf/cudf/core/multiindex.py 92.14% <ø> (ø)
python/cudf/cudf/core/series.py 95.28% <ø> (ø)
python/cudf/cudf/utils/cudautils.py 59.83% <ø> (ø)
python/cudf/cudf/utils/ioutils.py 79.60% <ø> (ø)
python/cudf/cudf/utils/utils.py 90.28% <ø> (ø)
python/cudf/cudf/core/frame.py 93.67% <56.52%> (-1.09%) ⬇️
python/dask_cudf/dask_cudf/tests/utils.py 90.90% <90.90%> (ø)
python/cudf/cudf/core/column/lists.py 92.79% <100.00%> (+1.38%) ⬆️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ac27757...8835532. Read the comment docs.

@bdice bdice marked this pull request as ready for review April 14, 2022 20:06
@bdice bdice requested review from PointKernel and vyasr April 15, 2022 14:41
Copy link
Member

@PointKernel PointKernel left a comment

Choose a reason for hiding this comment

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

The simplified file type logic should work but I didn't test it. Otherwise, LGTM.

.pre-commit-config.yaml Show resolved Hide resolved
@vyasr
Copy link
Contributor

vyasr commented Apr 25, 2022

@gpucibot merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants