Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
cbmroot
Merge requests
!502
Allow Licence Header skip
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Allow Licence Header skip
e.clerkin/cbmroot:licence_check_2
into
master
Overview
1
Commits
1
Pipelines
0
Changes
1
Closed
Eoin Clerkin
requested to merge
e.clerkin/cbmroot:licence_check_2
into
master
3 years ago
Overview
1
Commits
1
Pipelines
0
Changes
1
Expand
Amended licence header check to allow inclusion of a skip.
0
0
Merge request reports
Compare
master
version 1
c65a5a11
3 years ago
master (base)
and
latest version
latest version
ad2dba35
1 commit,
3 years ago
version 1
c65a5a11
1 commit,
3 years ago
1 file
+
9
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
scripts/check-licence-header.sh
+
9
−
0
Options
@@ -20,6 +20,13 @@ RETURN_CODE="0"
licenceHeaderCheck
()
{
FILE_CODE
=
"0"
;
head
-n
1
$1
|
grep
-q
'// Licence-Check-Skip \[ .[^]]*]'
if
[
$?
-eq
0
]
;
then
echo
-n
"[SKIP]
$1
, "
head
-n
1
$1
|
sed
's/^[^\[]*/ /'
else
sed
-n
'2p'
$1
|
grep
-q
' SPDX-License-Identifier: GPL-3.0-only'
if
[
$?
-ne
0
]
;
then
echo
"[ERROR]
$1
, line 2 missing spdx licence header declaration."
@@ -51,6 +58,8 @@ licenceHeaderCheck () {
if
[[
${
FILE_CODE
}
-eq
0
]]
;
then
echo
"[OK] File:
$1
passes licence header check."
fi
fi
}
Loading