KhronosGroup / KhronosGroup/SYCL-Docs

No consistancy style enforced in [code]

Open
#702 3 comments 0 reactions 0 assignees View on GitHub
editorial
Dominant language
JavaScript
Stars
158
Forks
80
Avg merge
7d 6h
Merged PRs (30d)
5

Description

We use `template class backend_traits {` and `template` aka `SpaceAfterTemplateKeyword` in clang format

```
applenco@aurora-uan-0012:~/SYCL-Docs> rg "template<" | wc -l
418
applenco@aurora-uan-0012:~/SYCL-Docs> rg "template <" | wc -l
463
```

Also, sometimes function arguments are in their own line, sometime we try to fill everything up to 80 chars and split, sometimes one per line (named `BinPackParameters` in clang-format)

```
template
explicit queue(const context& syclContext,
const DeviceSelector& deviceSelector,
const property_list& propList = {});
```

```
template
T atomic_fetch_xor(atomic object, T operand,
memory_order memoryOrder = memory_order::relaxed);
```

```
exception(context ctx, std::error_code ec, const std::string& what_arg);
```

I don't really care; we should just be consistent. I have a script that can reformat everything. We should just pick the correct option for clang-format.

Then, we ran rust clang-format in the CI and live happily long after.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by using the reported rg searches to measure the inconsistent template spacing and review the shown function-argument layouts. Choose the clang-format options for template spacing and parameter packing, apply the existing reformatting script, and verify that clang-format runs successfully in CI.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
ci-cd, documentation, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.