]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Detect overly long CHANGES lines
authorMark Andrews <marka@isc.org>
Wed, 27 Jan 2021 02:00:38 +0000 (13:00 +1100)
committerMark Andrews <marka@isc.org>
Thu, 28 Jan 2021 04:08:09 +0000 (15:08 +1100)
(cherry picked from commit b1ecab63835f15f456db35036305f9ec55ba1602)

.gitlab-ci.yml
util/check-line-length.sh [new file with mode: 0644]
util/copyrights

index be88b0d2aaf95bc9394f51bf043eb03ea277181d..05c7463e34ac2cac501b69397a33c115eb01407a 100644 (file)
@@ -425,9 +425,11 @@ misc:
     - sh util/tabify-changes < CHANGES > CHANGES.tmp
     - diff -urNap CHANGES CHANGES.tmp
     - perl util/check-changes CHANGES
+    - sh util/check-line-length.sh CHANGES
     - test ! -f CHANGES.SE || sh util/tabify-changes < CHANGES.SE > CHANGES.tmp
     - test ! -f CHANGES.SE || diff -urNap CHANGES.SE CHANGES.tmp
     - test ! -f CHANGES.SE || perl util/check-changes master=0 CHANGES.SE
+    - test ! -f CHANGES.SE || sh util/check-line-length.sh CHANGES.SE
     - rm CHANGES.tmp
     - perl -w util/merge_copyrights
     - diff -urNap util/copyrights util/newcopyrights
diff --git a/util/check-line-length.sh b/util/check-line-length.sh
new file mode 100644 (file)
index 0000000..3114dba
--- /dev/null
@@ -0,0 +1,22 @@
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, you can obtain one at https://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+expand "$1" |
+awk -v file="$1" 'length > 80 {
+    if (logged == 0) {
+        print file ": Line Too Long"
+        logged = 1
+    }
+    print
+}
+END {
+    if (logged == 1) {
+        exit(1)
+    }
+}'
index 17e56052445117dfff0f4a47fc4fb03a3b7ce55e..d15cea93b999a1b567645a2ca1f929627150f5e4 100644 (file)
 ./util/check-cocci                             X       2018,2019,2020,2021
 ./util/check-includes.pl                       PERL    2000,2001,2004,2007,2012,2016,2017,2018,2019,2020,2021
 ./util/check-instincludes.sh                   SH      2000,2001,2004,2007,2012,2016,2018,2019,2020,2021
+./util/check-line-length.sh                    SH      2021
 ./util/check-make-install.in                   SH      2020
 ./util/check-pullups.pl                                PERL    2001,2002,2003,2004,2007,2012,2016,2018,2019,2020,2021
 ./util/check-sources.pl                                PERL    2000,2001,2004,2007,2012,2013,2016,2018,2019,2020,2021