Skip to content

Commit c6f30cd

Browse files
committed
project.xml / zproject.gsl : add a check_license_years="2" mode to hard-require Copyright years to be up to date
1 parent 553ea60 commit c6f30cd

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

project.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
repository := git repository holding project (optional)
5151
unique_class_name := "0"|"1" (optional, defaults to 0) As a failsafe, forbid naming agents or classes same as the project itself (can cause conflicts in generated header filenames). Disable explicitly (set to 0) only in legacy projects that can not regenerate otherwise, and try to fix those.
5252
license := optional common tag of the project's license ("MPLv2", "GPL-2.0+", "CompanyName Proprietary" etc.); see also license.xml for longer wording
53-
check_license_years := "0"|"1" (optional, defaults to 0) When a project is regenerated, and if any license text(s) are defined, we check that at least one Copyright line in at least one license text contains the current year, and warn if not. If this option is set to "1", we also pause so that interactive developers can see this warning better and intervene.
53+
check_license_years := "0"|"1"|"2" (optional, defaults to 0) When a project is regenerated, and if any license text(s) are defined, we check that at least one Copyright line in at least one license text contains the current year, and warn if not. If this option is set to "1", we also pause so that interactive developers can see this warning better and intervene. With "2" require that the year is mentioned, abort GSL with year if it is not.
5454
-->
5555
<project script = "zproject.gsl" name = "zproject"
5656

zproject.gsl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ function check_license_years (xml)
8080
thread.sleep (500)
8181
echo "W: Oh well, moving on with possibly obsoleted copyrights"
8282
endif
83+
if (my.xml.check_license_years ?= 2)
84+
abort "E: This project is configured to require that copyrights are up to date"
85+
endif
8386
endif
8487
endif
8588
endfunction

0 commit comments

Comments
 (0)