Skip to content

Commit e34d250

Browse files
Merge branch 'master' into helicity_MCTruth
2 parents a117e42 + 3e24dd5 commit e34d250

File tree

1,388 files changed

+320931
-104829
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,388 files changed

+320931
-104829
lines changed

.clang-format

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,60 @@ PenaltyBreakFirstLessLess: 120
3939
PenaltyBreakString: 1000
4040
PenaltyExcessCharacter: 1000000
4141
PenaltyReturnTypeOnItsOwnLine: 200
42-
SortIncludes: false
42+
SortIncludes: CaseSensitive
43+
IncludeBlocks: Regroup
44+
IncludeCategories:
45+
# O2Physics, PWG
46+
- Regex: ^(<|")PWG[A-Z]{2}/.*\.h
47+
Priority: 2
48+
CaseSensitive: true
49+
# O2Physics, non-PWG
50+
- Regex: ^(<|")(Common|ALICE3|DPG|EventFiltering|Tools|Tutorials)/.*\.h
51+
Priority: 3
52+
CaseSensitive: true
53+
# O2
54+
- Regex: ^(<|")(Algorithm|CCDB|Common[A-Z]|DataFormats|DCAFitter|Detectors|EMCAL|Field|Framework|FT0|FV0|GlobalTracking|ITS|MathUtils|MFT|MCH|MID|PHOS|PID|ReconstructionDataFormats|SimulationDataFormat|TOF|TPC|ZDC).*/.*\.h
55+
Priority: 4
56+
CaseSensitive: true
57+
# ROOT
58+
- Regex: ^(<|")(T[A-Z]|Math/|Roo[A-Z])[[:alnum:]/]+\.h
59+
Priority: 5
60+
CaseSensitive: true
61+
# known third-party: KFParticle
62+
- Regex: ^(<|")KF[A-Z][[:alnum:]]+\.h
63+
Priority: 6
64+
CaseSensitive: true
65+
# known third-party: FastJet
66+
- Regex: ^(<|")fastjet/
67+
Priority: 6
68+
CaseSensitive: true
69+
# known third-party: ONNX runtime
70+
- Regex: ^(<|")onnxruntime
71+
Priority: 6
72+
CaseSensitive: true
73+
# incomplete path to DataModel
74+
- Regex: ^(<|").*DataModel/
75+
Priority: 1
76+
CaseSensitive: true
77+
# other third-party
78+
- Regex: ^(<|")([[:alnum:]_]+/)+[[:alnum:]_]+\.h
79+
Priority: 6
80+
CaseSensitive: true
81+
# other local-looking file
82+
- Regex: ^".*\.
83+
Priority: 1
84+
CaseSensitive: true
85+
# C system
86+
- Regex: ^(<|")[[:lower:]_]+\.h(>|")
87+
Priority: 102
88+
CaseSensitive: true
89+
# C++ system
90+
- Regex: ^(<|")[[:lower:]_/]+(>|")
91+
Priority: 101
92+
CaseSensitive: true
93+
# rest
94+
- Regex: .*
95+
Priority: 100
4396
SpaceBeforeAssignmentOperators: true
4497
SpaceBeforeParens: ControlStatements
4598
SpaceInEmptyParentheses: false

.clang-tidy

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
11
CheckOptions:
2-
- key: CheckPathRegex
3-
value: '.*/O2/.*'
2+
- { key: CheckPathRegex, value: ".*/O2/.*" }
3+
# Naming conventions
4+
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
5+
- { key: readability-identifier-naming.ClassMemberPrefix, value: m }
6+
- { key: readability-identifier-naming.ConceptCase, value: CamelCase }
7+
- { key: readability-identifier-naming.ConstexprVariableCase, value: CamelCase }
8+
- { key: readability-identifier-naming.ConstexprVariableIgnoredRegexp, value: "^k[A-Z].*$" } # Allow "k" prefix.
9+
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
10+
- { key: readability-identifier-naming.EnumConstantCase, value: CamelCase }
11+
- { key: readability-identifier-naming.EnumConstantIgnoredRegexp, value: "^k[A-Z].*$" } # Allow "k" prefix.
12+
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
13+
- { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }
14+
- { key: readability-identifier-naming.MacroDefinitionIgnoredRegexp, value: "^[A-Z]+(_[A-Z]+)*_$" } # Allow the trailing underscore in header guards.
15+
- { key: readability-identifier-naming.MemberCase, value: camelBack }
16+
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
17+
- { key: readability-identifier-naming.ParameterCase, value: camelBack }
18+
- { key: readability-identifier-naming.StructCase, value: CamelCase }
19+
- { key: readability-identifier-naming.TemplateParameterCase, value: CamelCase }
20+
- { key: readability-identifier-naming.TypeAliasCase, value: CamelCase }
21+
- { key: readability-identifier-naming.TypedefCase, value: CamelCase }
22+
- { key: readability-identifier-naming.TypeTemplateParameterCase, value: CamelCase }
23+
- { key: readability-identifier-naming.VariableCase, value: camelBack }

.git-blame-ignore-revs

Whitespace-only changes.

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
# Dependabot configuration
3+
# Reference: https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
4+
5+
version: 2
6+
updates:
7+
- package-ecosystem: "github-actions" # See documentation for possible values
8+
directory: "/" # Location of package manifests
9+
schedule:
10+
interval: "weekly"

.github/labeler.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ infrastructure:
1616
- '.github/**'
1717
- '.checkov.yml'
1818
- '.mega-linter.yml'
19+
- '.pre-commit-config.yaml'
1920
- 'cmake/**'
2021
- 'CODEOWNERS'
2122
- 'CPPLINT.cfg'
@@ -25,7 +26,7 @@ infrastructure:
2526

2627
datamodel:
2728
- changed-files:
28-
- any-glob-to-any-file: ['DataModel/**', '*/DataModel/**']
29+
- any-glob-to-any-file: ['DataModel/**', '**/DataModel/**']
2930

3031
dpg:
3132
- changed-files:

.github/workflows/mega-linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
id: ml
3939
# You can override MegaLinter flavor used to have faster performances
4040
# More info at https://megalinter.io/flavors/
41-
uses: oxsecurity/megalinter@v8.3.0
41+
uses: oxsecurity/megalinter@v8.7.0
4242
env:
4343
# All available variables are described in documentation:
4444
# https://megalinter.io/configuration/

.github/workflows/o2-linter.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# Find issues in O2 code
33
name: O2 linter
44

5-
'on': [pull_request, push]
5+
"on": [pull_request_target, push]
66
permissions: {}
77
env:
8-
MAIN_BRANCH: master
8+
BRANCH_MAIN: master
99

1010
concurrency:
1111
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
@@ -15,20 +15,47 @@ jobs:
1515
o2-linter:
1616
name: O2 linter
1717
runs-on: ubuntu-24.04
18+
permissions:
19+
pull-requests: write
1820
steps:
21+
- name: Set branches
22+
run: |
23+
if [[ "${{ github.event_name }}" == "push" ]]; then
24+
branch_head="${{ github.ref }}"
25+
branch_base="${{ env.BRANCH_MAIN }}"
26+
else
27+
branch_head="refs/pull/${{ github.event.pull_request.number }}/merge"
28+
branch_base="${{ github.event.pull_request.base.ref }}"
29+
fi
30+
echo BRANCH_HEAD="$branch_head" >> "$GITHUB_ENV"
31+
echo BRANCH_BASE="$branch_base" >> "$GITHUB_ENV"
1932
- name: Checkout Code
2033
uses: actions/checkout@v4
2134
with:
35+
ref: ${{ env.BRANCH_HEAD }}
2236
fetch-depth: 0 # needed to get the full history
2337
- name: Run tests
38+
id: linter
2439
run: |
25-
# Diff against the common ancestor of the source branch and the main branch.
26-
readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.MAIN_BRANCH }}...)
40+
# Diff against the common ancestor of the source (head) branch and the target (base) branch.
41+
echo "Diffing ${{ env.BRANCH_HEAD }} against ${{ env.BRANCH_BASE }}."
42+
readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.BRANCH_BASE }}...)
2743
if [ ${#files[@]} -eq 0 ]; then
2844
echo "::notice::No files to lint."
45+
echo "linter_ran=0" >> "$GITHUB_OUTPUT"
2946
exit 0
3047
fi
31-
[ ${{ github.event_name }} == 'pull_request' ] && options="-g"
48+
echo "linter_ran=1" >> "$GITHUB_OUTPUT"
49+
[[ "${{ github.event_name }}" == "pull_request_target" ]] && options="-g"
3250
# shellcheck disable=SC2086 # Ignore unquoted options.
3351
python3 Scripts/o2_linter.py $options "${files[@]}"
3452
echo "Tip: If you allow actions in your fork repository, O2 linter will run when you push commits."
53+
- name: Comment PR
54+
if: (success() || failure()) && (github.event_name == 'pull_request_target' && steps.linter.outputs.linter_ran == 1)
55+
uses: thollander/actions-comment-pull-request@v3
56+
with:
57+
comment-tag: o2-linter
58+
message: "**O2 linter results:**
59+
❌ ${{ steps.linter.outputs.n_issues }} errors,
60+
⚠️ ${{ steps.linter.outputs.n_tolerated }} warnings,
61+
🔕 ${{ steps.linter.outputs.n_disabled }} disabled"

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
stale:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/stale@v1
15+
- uses: actions/stale@v9
1616
with:
1717
repo-token: ${{ secrets.GITHUB_TOKEN }}
1818
stale-pr-message: 'This PR has not been updated in the last 30 days. Is it still needed? Unless further action is taken, it will be closed in 5 days.'

.mega-linter.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ DISABLE_LINTERS:
1515
- BASH_SHFMT
1616
- CPP_CLANG_FORMAT
1717
- JSON_PRETTIER
18+
- PYTHON_BLACK
19+
- PYTHON_FLAKE8
20+
- PYTHON_ISORT
1821
- REPOSITORY_DEVSKIM
22+
- REPOSITORY_GITLEAKS
1923
- REPOSITORY_KICS
2024
- REPOSITORY_SECRETLINT
2125
- REPOSITORY_TRIVY
@@ -35,3 +39,5 @@ PYTHON_PYRIGHT_CONFIG_FILE: pyproject.toml
3539
PYTHON_RUFF_CONFIG_FILE: pyproject.toml
3640
CPP_CPPLINT_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".cu", ".cuh", ".cxx", ".cxx.in", ".h", ".h++", ".hh", ".h.in", ".hpp", ".hxx", ".inc", ".inl", ".macro"]
3741
CPP_CLANG_FORMAT_FILE_EXTENSIONS: [".C", ".c", ".c++", ".cc", ".cl", ".cpp", ".cu", ".cuh", ".cxx", ".cxx.in", ".h", ".h++", ".hh", ".h.in", ".hpp", ".hxx", ".inc", ".inl", ".macro"]
42+
CPP_CPPCHECK_ARGUMENTS: --language=c++ --std=c++20 --check-level=exhaustive --suppressions-list=cppcheck_config
43+
REPOSITORY_GITLEAKS_PR_COMMITS_SCAN: true

.pre-commit-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v5.0.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- repo: https://github.com/pre-commit/mirrors-clang-format
10+
rev: v20.1.5 # clang-format version
11+
hooks:
12+
- id: clang-format
13+
- repo: https://github.com/cpplint/cpplint
14+
rev: 2.0.2
15+
hooks:
16+
- id: cpplint

0 commit comments

Comments
 (0)