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

Add .clang-format to enforce project style #204

Merged
merged 3 commits into from
Jan 6, 2024

Conversation

prashanthswami
Copy link
Collaborator

The settings here match the current settings for the pytorch/pytorch project, with the exception that 8-character-width tabs are preferred in place of spaces.

In addition to adding .clang-format, we also run it once on the whole code-base to clean up the existing usages.

Review: @malfet
CC: @GlassOfWhiskey

@prashanthswami
Copy link
Collaborator Author

prashanthswami commented Nov 22, 2023

Are we opinionated about the clang-format version? By default, the Github action tracks to version 13, but we could set it higher. Edit: I'll stick with -13. PyTorch seems to default to an open-source -12 version. At the very least, we can track this workflow's version for now. It's not too hard to change later, if desired.

@prashanthswami prashanthswami force-pushed the add-clang-format branch 3 times, most recently from 81522a1 to 06241e0 Compare November 29, 2023 01:46
.clang-format Outdated Show resolved Hide resolved
The settings here match the current settings for the pytorch/pytorch
project, with the exception that 8-character-width tabs are preferred in
place of spaces.
@prashanthswami prashanthswami force-pushed the add-clang-format branch 3 times, most recently from be35b1b to 92046ee Compare January 5, 2024 20:06
Now that we have a clang-format file defined, clean up all usages once.
Enforce clang-format consistency on all new changes.
@malfet malfet merged commit 42bff7a into pytorch:main Jan 6, 2024
9 checks passed
markdryan added a commit to markdryan/cpuinfo that referenced this pull request Jan 11, 2024
PR pytorch#204 broke the RISC-V
build by including for a second time a header file that currently
only exists in the RISC-V Android NDK.  The header is not yet
available in mainstream Linux distributions.  The header in question,
<sys/hwprobe.h>, is already included when building for Android
at the top of riscv-hw.c so the second include is unnecessary and
can be safely removed.
@prashanthswami prashanthswami deleted the add-clang-format branch January 11, 2024 17:24
malfet pushed a commit that referenced this pull request Jan 22, 2024
PR #204 broke the RISC-V
build by including for a second time a header file that currently
only exists in the RISC-V Android NDK.  The header is not yet
available in mainstream Linux distributions.  The header in question,
<sys/hwprobe.h>, is already included when building for Android
at the top of riscv-hw.c so the second include is unnecessary and
can be safely removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants