Skip to content

Automate C++ include file grouping and ordering using clang-format - #5787

Merged
rapids-bot[bot] merged 2 commits into
NVIDIA:branch-24.04from
harrism:fea/clang-format-header-grouping
Feb 29, 2024
Merged

Automate C++ include file grouping and ordering using clang-format#5787
rapids-bot[bot] merged 2 commits into
NVIDIA:branch-24.04from
harrism:fea/clang-format-header-grouping

Conversation

@harrism

@harrism harrism commented Feb 28, 2024

Copy link
Copy Markdown
Contributor

Description

This uses the IncludeCategories settings in .clang-format to automate include ordering and grouping and to make include ordering more consistent with the rest of RAPIDS. For discussion, see NVIDIA/cudf#15063. This PR uses a similar set of header grouping categories used in that PR, adapted for cuML.

One purpose of this is to make it easier to automate injection of a header change with an upcoming RMM refactoring (and in the future).

The header reordering in this PR uncovered multiple places where headers were not included where they are used. Most commonly this was a missing #include <raft/core/handle.hpp>

Closes #5779

@harrism
harrism requested a review from a team as a code owner February 28, 2024 04:19
@bdice bdice added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Feb 28, 2024

@dantegd dantegd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Rules lgtm. If we add other RAPIDS C++ libraries in the future we'll add them, but for now those seem well covered.

@harrism harrism self-assigned this Feb 29, 2024
@dantegd

dantegd commented Feb 29, 2024

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit a356ec6 into NVIDIA:branch-24.04 Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CUDA/C++ 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.

Automate C++ include file grouping and ordering using clang-format

3 participants