Skip to content

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

@mhoemmen

Description

@mhoemmen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions