Skip to content

Github code format

Ashar edited this page Jun 29, 2020 · 5 revisions

Clang Format Checks

We are using default code format style of clang-format, in future when Boost.uBLAS agrees to use one code format style, the code format style file named .clang-format will be added in the root of the project and our CI will be formatting and checking based on that style file.

The following codes are only affected by code formatting:

 examples/tensor/*.cpp
 tests/tensor/*.cpp
 include/numeric/ublas/tensor/*.hpp (any hpp inside tensor directory)
 include/numeric/ublas/tensor/*/*.hpp (any subdirectory inside tensor with hpp extension)

If you want to cover more areas with code formatting, please add the location to that directory in the file named check_format.yml inside of the .github/workflows directory.

In Action

When I added the CI workflow for the Code format check, the code was not correctly formatted to any one single style. The CI checked it and found that the code format was not well, so it failed. You can check the failure here

NOTE: CI will fail if code is not correctly formatted, both for Push and PR