kokkos/stdBLAS

Choose code formatting style and add clang-format configuration file

mhoemmen opened this issue · 0 comments

PR #235 adds a .clang-format file to the repository. It implements a suggested clang-format code style, and points out that the repository would benefit from choosing some code style. This leads to the question of what code style to use.

For a reference implementation of a WG21 proposal, I would prefer to use a style that permits copy-and-paste of code directly into the proposal. However, I did not find a .clang-format template for the WG21 code style. One suggestion was to use the "whatstyle" tool (https://github.com/mikr/whatstyle) on samples of C++ Standard code to deduce clang-format options.

Kokkos' .clang-format was written for clang 8. In my experience, clang-format for clang < 13 does poorly with C++20 code, in particular code that uses concepts. However, the reference implementation of P1673 currently works with C++17 and aims for the same language version requirements as the reference mdspan (P0009) implementation.