pytorch / cpuinfo

CPU INFOrmation library (x86/x86-64/ARM/ARM64, Linux/Windows/Android/macOS/iOS)
BSD 2-Clause "Simplified" License
962 stars 306 forks source link

Add .clang-format to enforce project style #204

Closed prashanthswami closed 6 months ago

prashanthswami commented 7 months ago

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 commented 7 months ago

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.