-
Notifications
You must be signed in to change notification settings - Fork 190
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
Format libcudacxx/include files without extensions #1676
Format libcudacxx/include files without extensions #1676
Conversation
.pre-commit-config.yaml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explaining the changes here:
pre-commit looks at types
(filetypes with conjunction AND), types_or
(filetypes with conjunction OR), files
(positive filter regex), and exclude
(negative filter regex). See docs:
- https://pre-commit.com/#pre-commit-configyaml---hooks
- https://pre-commit.com/#filtering-files-with-types
The extension-to-type mapping is defined by the identify
package. The source code for that is here. https://github.com/pre-commit/identify/blob/main/identify/extensions.py
I ran the following snippet on the EXTENSIONS
defined in that file:
types_or = {"c", "c++", "cuda"}
for k, v in EXTENSIONS.items():
if any(t in v for t in types_or):
print(k)
Then I checked the list:
c
c++
c++m
cc
ccm
cpp
cppm
cu
cuh
cxx
cxxm
h
hh
hpp
hxx
inl
ino
ixx
mm
I dropped the extensions that do not appear in the CCCL repo, and added regexes for those that do appear in this repo.
Then I added one more regex line: ^libcudacxx/include/.*/[^.]*$
which will handle the extensionless includes.
This reverts commit f542bf3.
…nclude-extensionless-files
pre-commit.ci autofix |
/ok to test |
We need to keep that order
🟨 CI Results [ Failed: 2 | Passed: 304 | Total: 306 ]
|
# | Runner |
---|---|
232 | linux-amd64-cpu16 |
32 | linux-amd64-gpu-v100-latest-1 |
24 | linux-arm64-cpu16 |
18 | windows-amd64-cpu16 |
👃 Inspect Changes
Modifications in project?
Project | |
---|---|
+/- | CCCL Infrastructure |
+/- | libcu++ |
CUB | |
Thrust |
Modifications in project or dependencies?
Project | |
---|---|
+/- | CCCL Infrastructure |
+/- | libcu++ |
+/- | CUB |
+/- | Thrust |
🟩 CI Results [ Failed: 0 | Passed: 306 | Total: 306 ]
|
# | Runner |
---|---|
232 | linux-amd64-cpu16 |
32 | linux-amd64-gpu-v100-latest-1 |
24 | linux-arm64-cpu16 |
18 | windows-amd64-cpu16 |
👃 Inspect Changes
Modifications in project?
Project | |
---|---|
+/- | CCCL Infrastructure |
+/- | libcu++ |
CUB | |
Thrust |
Modifications in project or dependencies?
Project | |
---|---|
+/- | CCCL Infrastructure |
+/- | libcu++ |
+/- | CUB |
+/- | Thrust |
/ok to test |
🟩 CI Results [ Failed: 0 | Passed: 306 | Total: 306 ]
|
# | Runner |
---|---|
232 | linux-amd64-cpu16 |
32 | linux-amd64-gpu-v100-latest-1 |
24 | linux-arm64-cpu16 |
18 | windows-amd64-cpu16 |
👃 Inspect Changes
Modifications in project?
Project | |
---|---|
+/- | CCCL Infrastructure |
+/- | libcu++ |
CUB | |
Thrust |
Modifications in project or dependencies?
Project | |
---|---|
+/- | CCCL Infrastructure |
+/- | libcu++ |
+/- | CUB |
+/- | Thrust |
Thanks a lot for helping fixing this |
Description
This PR extends #1670 by adding rules to
pre-commit
that invokeclang-format
over all extensionless headers in libcudacxx.Checklist