Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update more documentation #21

Merged
merged 1 commit into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 45 additions & 64 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,82 +4,63 @@
name: static analysis
on:
push:
branches: [ dev ]
branches: [dev, edwin_dev]
pull_request:
branches: [ dev ]
branches: [dev, edwin_dev]

workflow_dispatch:

permissions: write-all
permissions:
pull-requests: write
contents: write

jobs:
# This workflow contains a single job called "clang-format"
clang-format:
clang-lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Code formatting
run: |
cd $GITHUB_WORKSPACE
sudo apt-get update
sudo apt-get install clang-format-15
./util/clang-format-check.sh clang-format-15
defaults:
run:
shell: bash

clang-tidy:
runs-on: ubuntu-latest
strategy:
matrix:
preset: [ default ]
os: [ debian12 ]
container:
image: yanzhaowang/cvmfs_clang:${{ matrix.os }}
volumes:
- /tmp:/cvmfs
env:
CVMDIR: /cvmfs/fairsoft.gsi.de
options: --user root --privileged --ulimit nofile=9999:10000 --cap-add SYS_ADMIN --device /dev/fuse
preset: [default]
os: [ubuntu-latest]
container:
image: yanzhaowang/fairroot:${{ matrix.os }}
options: --user root --privileged
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: pre-build
uses: './.github/actions/pre-build'

- name: install deps
id: restore-caching
uses: './.github/actions/install-deps'
with:
cache-name: 'false'
- uses: actions/checkout@v4
with:
submodules: 'true'

- name: configure r3broot
uses: './.github/actions/r3bbuild-steps'
with:
build-needed: 'false'
- name: install sudo
run: |
apt-get install -y sudo
sudo -H python3 -m pip install conan

- name: clang-tidy check
run: |
mkdir -p clang-tidy-result
git diff -U0 HEAD^ | python3 $PWD/util/clang-tidy-diff.py -p1 -path build -j4 -use-color \
-iregex '^(.*\/)(?!ext_)([^\/]*\.(cpp|cc|c\+\+|cxx|cl|hpp|hh|h|m|mm|inc))$' \
> clang-tidy-result/fixes.yml
cat clang-tidy-result/fixes.yml |\
sed -e 's/\x1b\[[0-9;]*m//g' |\
sed 's/\(^.*\):\([0-9]*\):\([0-9]*\): warning:/::warning file=\1,line=\2,col=\3::/' |\
sed 's/\(^.*\):\([0-9]*\):\([0-9]*\): error:/::error file=\1,line=\2,col=\3::/'
echo "WARN_NUM=$(sed -e 's/\x1b\[[0-9;]*m//g' clang-tidy-result/fixes.yml | grep -w " warning:" | wc -l | xargs)" >> $GITHUB_ENV
echo "ERROR_NUM=$(sed -e 's/\x1b\[[0-9;]*m//g' clang-tidy-result/fixes.yml | grep -w " error:" | wc -l | xargs)" >> $GITHUB_ENV
- name: configure r3broot
uses: './.github/actions/r3bbuild-steps'
with:
build-needed: 'false'

- name: clang-tidy results
run: |
if [ "${{ env.WARN_NUM }}" -eq "0" ] && [ "${{ env.ERROR_NUM }}" -eq "0" ]; then
echo "::notice::All clean, LGTM!"
else
cat clang-tidy-result/fixes.yml | sed -e 's/\x1b\[[0-9;]*mnote: \x1b\[0m/\x1b\[33mnote: \x1b\[0m/g'
echo "::notice::Clang-tidy generates ${{ env.WARN_NUM }} warnings and ${{ env.ERROR_NUM }} errors! Please fix them before being merged."
exit 1
fi
shell: bash
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: 'file'
tidy-checks: ''
version: 18
lines-changed-only: true
database: build
thread-comments: update
tidy-review: true
file-annotations: true
format-review: true
passive-reviews: true
extensions: 'h,cxx'
ignore: '*|!neuland|!r3bbase|!r3bdata|!r3bsource|ext_h101*'

- name: Fail fast?!
if: steps.linter.outputs.checks-failed > 0
run: exit 1
2 changes: 0 additions & 2 deletions neuland/digitizing/R3BDigitizingEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
#ifndef NEULAND_DIGITIZING_ENGINE_H
#define NEULAND_DIGITIZING_ENGINE_H

#include "FairLogger.h"
#include "R3BDigitizingChannel.h"
#include "R3BDigitizingPaddle.h"
#include "Rtypes.h"
#include <cmath>
#include <functional>
#include <map>
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion neuland/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Code for the NeuLAND Detector is split into different components:
- test
- unpack
- shared
- executables
- [executables](executables/readme.md)
- neulandData (in `../r3bdata/neulandData`).
- [online](online/readme.md)

Expand Down
Loading