Skip to content

Commit be271a1

Browse files
authored
Merge pull request #305 from vkucera/hf
PWGHF: Update guidelines for sorting includes
2 parents 8ca7793 + 6dbcf68 commit be271a1

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

docs/advanced-specifics/pwghf.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,15 +192,26 @@ Directories: [`PWGHF/D2H/Macros`](https://github.com/AliceO2Group/O2Physics/tree
192192
- `error` for problems that lead to an unwanted behaviour of the code,
193193
- `fatal` for critical problems that make further running of the code impossible or useless.
194194
- Include only needed headers but do not rely on implicitly included headers. See [Include What You Use](https://github.com/AliceO2Group/O2Physics/issues/8357).
195-
- Organise `#include`s into groups (separated by a blank line) in the following order:
196-
- C++
197-
- other external headers
198-
- ROOT
199-
- O2
200-
- O2Physics
201-
- PWG other than HF
202-
- PWGHF
203-
- Put PAG headers after the common ones.
195+
- Sort `#include`s from most specific to least specific and organise them into groups (separated by a blank line) in the following order (can be done automatically with [clang-format](../tools/README.md#pre-commit-hooks)):
196+
197+
1. Main module
198+
2. Local-like file
199+
3. Project (O2Physics)
200+
- PWG (You can surround the PWG block with `// clang-format off` and `// clang-format on` directives to preserve the order.)
201+
- Same PWG, same PAG
202+
- Same PWG, different PAG
203+
- Same PWG, non-PAG
204+
- Other PWG
205+
- Other
206+
4. Third-party
207+
- O2
208+
- ROOT
209+
- Other non-system (FastJet, ONNX, KFParticle,...)
210+
- Anything else
211+
5. System
212+
- C++ standard library
213+
- C standard library
214+
204215
- Sort `#include`s alphabetically within a group.
205216
- Avoid using hard-coded PDG codes. Use their `enum` names instead
206217
(from [`PDG_t`](https://root.cern/doc/master/TPDGCode_8h.html) or

0 commit comments

Comments
 (0)