From 0ac3aa11655a9693de86f4c629d9229461895c4d Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Tue, 18 Jun 2024 17:09:06 +0100 Subject: [PATCH] Enforce copyright header --- .github/workflows/qc/action.yml | 27 +++++++++++++-------------- .github/workflows/qc/copyright.txt | 2 ++ src/AxisModel.qml | 3 +++ src/LineModel.qml | 3 +++ src/ScatterModel.qml | 3 +++ src/axis.cpp | 3 +++ src/axis.h | 3 +++ src/axisTickLabels.cpp | 3 +++ src/axisTickLabels.h | 3 +++ src/lineGeometry.cpp | 3 +++ src/lineGeometry.h | 3 +++ src/logAxis.cpp | 3 +++ src/logAxis.h | 3 +++ src/main.cpp | 3 +++ src/main.qml | 3 +++ src/plotGeometry.cpp | 3 +++ src/plotGeometry.h | 3 +++ src/scatterGeometry.cpp | 3 +++ src/scatterGeometry.h | 3 +++ src/triangle.cpp | 3 +++ src/triangle.h | 3 +++ 21 files changed, 72 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/qc/copyright.txt diff --git a/.github/workflows/qc/action.yml b/.github/workflows/qc/action.yml index ae06b07..473f25f 100644 --- a/.github/workflows/qc/action.yml +++ b/.github/workflows/qc/action.yml @@ -55,17 +55,16 @@ runs: git diff git diff --quiet -# - name: Copyright Year -# condition: eq(0,1) -# shell: bash -# run: | -# set -ex -# -# # Find all occurances of "YYYY Team QuickPlot and contributors" and replace YYYY with the current year -# find . -type f -not -path '.git/*' -exec sed -i "s/[0-9]{4} \(Team QuickPlot and contributors\)/$(date +%Y) \1/g" {} + -# -# # Show the diff to give an indication of the issues in the CI log -# git diff -# -# # Run quiet diff to fail the job if any changes were made (see man git-diff) -# git diff --quiet + - name: Copyright Year + shell: bash + run: | + set -ex + + # Find all occurances of "YYYY Team QuickPlot and contributors" and replace YYYY with the current year + find . -type f -not -path '.git/*' -exec sed -i "s/[0-9]{4} \(Team QuickPlot and contributors\)/$(date +%Y) \1/g" {} + + + # Show the diff to give an indication of the issues in the CI log + git diff + + # Run quiet diff to fail the job if any changes were made (see man git-diff) + git diff --quiet diff --git a/.github/workflows/qc/copyright.txt b/.github/workflows/qc/copyright.txt new file mode 100644 index 0000000..dbf0eb5 --- /dev/null +++ b/.github/workflows/qc/copyright.txt @@ -0,0 +1,2 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors diff --git a/src/AxisModel.qml b/src/AxisModel.qml index 96a18d9..7b552c0 100644 --- a/src/AxisModel.qml +++ b/src/AxisModel.qml @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + import QtQuick import QtQuick3D import com.projectdissolve diff --git a/src/LineModel.qml b/src/LineModel.qml index d7d0783..5da4a42 100644 --- a/src/LineModel.qml +++ b/src/LineModel.qml @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + import QtQuick import QtQuick3D import com.projectdissolve diff --git a/src/ScatterModel.qml b/src/ScatterModel.qml index 93bd71d..ba2133a 100644 --- a/src/ScatterModel.qml +++ b/src/ScatterModel.qml @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + import QtQuick import QtQuick3D import com.projectdissolve diff --git a/src/axis.cpp b/src/axis.cpp index a145ef0..21b1c36 100644 --- a/src/axis.cpp +++ b/src/axis.cpp @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + #include "axis.h" #include diff --git a/src/axis.h b/src/axis.h index 3614fa7..f39ddaa 100644 --- a/src/axis.h +++ b/src/axis.h @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + #pragma once #include "axisTickLabels.h" diff --git a/src/axisTickLabels.cpp b/src/axisTickLabels.cpp index cc863d3..e2956d0 100644 --- a/src/axisTickLabels.cpp +++ b/src/axisTickLabels.cpp @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + #include "axisTickLabels.h" #include "axis.h" #include diff --git a/src/axisTickLabels.h b/src/axisTickLabels.h index 0ce3098..3eb25d7 100644 --- a/src/axisTickLabels.h +++ b/src/axisTickLabels.h @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + #pragma once #include diff --git a/src/lineGeometry.cpp b/src/lineGeometry.cpp index 76cb8b1..248ecc5 100644 --- a/src/lineGeometry.cpp +++ b/src/lineGeometry.cpp @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + #include "lineGeometry.h" #include "triangle.h" #include diff --git a/src/lineGeometry.h b/src/lineGeometry.h index da1b681..ef906d4 100644 --- a/src/lineGeometry.h +++ b/src/lineGeometry.h @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + #pragma once #include "axis.h" diff --git a/src/logAxis.cpp b/src/logAxis.cpp index 4d7b611..91de9d8 100644 --- a/src/logAxis.cpp +++ b/src/logAxis.cpp @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + #include "logAxis.h" #include diff --git a/src/logAxis.h b/src/logAxis.h index df9641e..64fb1bc 100644 --- a/src/logAxis.h +++ b/src/logAxis.h @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + #pragma once #include "axis.h" diff --git a/src/main.cpp b/src/main.cpp index 1e1063f..6394721 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + #include "lineGeometry.h" #include #include diff --git a/src/main.qml b/src/main.qml index 3e9a8b2..ee7c920 100644 --- a/src/main.qml +++ b/src/main.qml @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + import QtQuick import QtQuick.Controls import QtQuick.Dialogs diff --git a/src/plotGeometry.cpp b/src/plotGeometry.cpp index c347743..52eeaff 100644 --- a/src/plotGeometry.cpp +++ b/src/plotGeometry.cpp @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + #include "plotGeometry.h" PlotGeometry::PlotGeometry() : xAxis_(nullptr), yAxis_(nullptr) diff --git a/src/plotGeometry.h b/src/plotGeometry.h index 96b3d7e..732eabf 100644 --- a/src/plotGeometry.h +++ b/src/plotGeometry.h @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + #pragma once #include "axis.h" diff --git a/src/scatterGeometry.cpp b/src/scatterGeometry.cpp index 1bc96c6..c0f15e0 100644 --- a/src/scatterGeometry.cpp +++ b/src/scatterGeometry.cpp @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + #include "scatterGeometry.h" #include "triangle.h" #include diff --git a/src/scatterGeometry.h b/src/scatterGeometry.h index 08fb52d..20a1514 100644 --- a/src/scatterGeometry.h +++ b/src/scatterGeometry.h @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + #pragma once #include "axis.h" diff --git a/src/triangle.cpp b/src/triangle.cpp index 0f41ecd..c152327 100644 --- a/src/triangle.cpp +++ b/src/triangle.cpp @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + #include "triangle.h" Point::Point(float a, float b, float c) : x(a), y(b), z(c) {} diff --git a/src/triangle.h b/src/triangle.h index 9ebd213..caea9ed 100644 --- a/src/triangle.h +++ b/src/triangle.h @@ -1,3 +1,6 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +// Copyright (c) 2024 Team Dissolve and contributors + #pragma once class Point