Skip to content
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
53 changes: 52 additions & 1 deletion .github/workflows/code-formatting.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Check PR with clang-format
name: PR formatting

on: [pull_request_target]

jobs:
clang-format:
name: clang-format
# We need at least 20.04 to install clang-format-11.
runs-on: ubuntu-20.04

Expand Down Expand Up @@ -99,3 +100,53 @@ jobs:
true) echo 'PR clean' ; exit 0 ;;
false) echo 'PR not clean' ; exit 1 ;;
esac

copyright:
name: copyright headers
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
# We need the history of the dev branch all the way back to where the PR
# diverged. We're fetching everything here, as we don't know how many
# commits back that point is.
fetch-depth: 0

- name: Check copyright headers
env:
# The expected copyright notice.
COPYRIGHT: |
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
run: |
# Run copyright notice check
copyright_lines=$(echo "$COPYRIGHT" | wc -l)
base_commit=$(git merge-base HEAD ${{ github.event.pull_request.base.sha }})
have_err=
git diff --diff-filter d --name-only "$base_commit" -- '*.cxx' '*.h' | while read -r file; do
if [ "$(head -n "$copyright_lines" "$file")" != "$COPYRIGHT" ]; then
echo "::error::$file: missing or malformed copyright notice" >&2
have_err=1
fi
done

# Tell user what to do in case of copyright notice error
if [ -n "$have_err" ]; then
cat << EOF >&2
::error::The files listed above are missing the correct copyright notice.
::error::Make sure all your source files begin with the following exact lines:
$COPYRIGHT
EOF
exit 1
fi
1 change: 0 additions & 1 deletion Common/Tasks/ft0Qa.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
Expand Down
9 changes: 5 additions & 4 deletions DPG/TableProducer/pidMLProducer.cxx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
Expand Down
9 changes: 5 additions & 4 deletions EventFiltering/PWGHF/HFFilter.cxx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
Expand Down
1 change: 0 additions & 1 deletion EventFiltering/PWGJE/jetFilter.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
Expand Down
9 changes: 5 additions & 4 deletions EventFiltering/PWGLF/strangenessFilter.cxx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
Expand Down
5 changes: 3 additions & 2 deletions EventFiltering/PWGMM/multFilter.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
Expand All @@ -9,11 +8,13 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
// O2 includes
//
// \file multFilter.cxx
// \brief task for selection of high multiplicity events
//
// \author Antonio Ortiz <antonio.ortiz.velasquez@cern.ch>, ICN-UNAM
//
// O2 includes

#include "ReconstructionDataFormats/Track.h"
#include "Framework/runDataProcessing.h"
Expand Down
9 changes: 5 additions & 4 deletions PWGCF/FemtoDream/FemtoDreamDetaDphiStar.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
Expand Down
Loading