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

Choose code formatting style and add clang-format configuration file #240

Open
mhoemmen opened this issue Jun 27, 2022 · 0 comments
Open

Comments

@mhoemmen
Copy link
Contributor

mhoemmen commented Jun 27, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant