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

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

Merged

Conversation

harrism
Copy link
Member

@harrism harrism commented Feb 27, 2024

Description

This uses the IncludeCategories settings in .clang-format to attempt to enforce our documented #include order in libcuspatial. For discussion, see rapidsai/cudf#15063. This PR uses a subset of the header grouping categories used in that PR.

Note that this also updates the pre-commit configuration to check and correct file copyright years. This comes from rapidsai/cudf#14917. @KyleFromNVIDIA can you confirm whether or not it's OK to do this? It seems to be working fine.

Closes #1345

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@harrism harrism added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Feb 27, 2024
@harrism harrism self-assigned this Feb 27, 2024
@harrism harrism requested a review from a team as a code owner February 27, 2024 04:11
@github-actions github-actions bot added the libcuspatial Relates to the cuSpatial C++ library label Feb 27, 2024
@KyleFromNVIDIA
Copy link
Contributor

+1 to the new copyright update script, we're planning to eventually roll that out to all RAPIDS repos.

Copy link
Contributor

@isVoid isVoid left a comment

Choose a reason for hiding this comment

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

One small question below.

Priority: 3
- Regex: '^<(cuspatial|cuproj)/' # cuSpatial/cuProj includes
Priority: 4
- Regex: '^<(cudf_test|cudf|cuml|raft|kvikio)' # Other RAPIDS includes
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought about removing cuml/raft/kvikio since they are not used, should it?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could, but I'm also trying to keep things relatively consistent across RAPIDS repos. But I'm not confident in that direction. Thoughts?

Copy link
Contributor

@isVoid isVoid Mar 4, 2024

Choose a reason for hiding this comment

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

Yeah I'm not confident either - especially if we apply this remove-not-used rule, then what about the cuda libraries below? If we remove cuda rules, are we sure that future contributors do not use them?

From that end, I think the future-facing approach is to maintain the disjunction set from all RAPIDS libraries to embed the collective behavioral customs. This reduces possible conflicts when migrating code or merging repos.

@harrism
Copy link
Member Author

harrism commented Mar 6, 2024

/merge

@rapids-bot rapids-bot bot merged commit baa1bbb into rapidsai:branch-24.04 Mar 6, 2024
71 checks passed
@harrism harrism deleted the fea/clang-format-header-grouping branch August 1, 2024 00:33
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 libcuspatial Relates to the cuSpatial C++ library non-breaking Non-breaking change
Projects
Status: Done
Status: Todo
Development

Successfully merging this pull request may close these issues.

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