From d9132e1cba66b5455a627251f377cd95eb008fc1 Mon Sep 17 00:00:00 2001 From: ng0 Date: Sun, 1 Dec 2019 23:19:58 +0000 Subject: convert texinfo checks to proper awk script, add detection for awk/gawk, remove obsolete code. --- contrib/scripts/check-texinfo.awk.in | 55 ++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 contrib/scripts/check-texinfo.awk.in (limited to 'contrib/scripts/check-texinfo.awk.in') diff --git a/contrib/scripts/check-texinfo.awk.in b/contrib/scripts/check-texinfo.awk.in new file mode 100755 index 000000000..12f71b5d2 --- /dev/null +++ b/contrib/scripts/check-texinfo.awk.in @@ -0,0 +1,55 @@ +#!@AWKEXE@ -f + +# Dedicated to the Public Domain. +# SPDX-License-Identifier: 0BSD + +BEGIN { + printf "Running basic texinfo linters\n" ; +} + +{ + if(/\t/) { + printf "...lines containing tabstops?\n" ; + print FILENAME":"NR":"$0 ; + } +} + +{ + if(length>79) { + printf "...line length over 79 chars?\n" ; + print FILENAME":"NR":"$0 ; + } +} + +{ + if(/@geq\{\}/) { + printf "...lines containing macros incompatible with old makeinfo?\n" ; + print FILENAME":"NR":"$0 ; + } +} + +{ + if (/@footnote\{/) { + printf "...lines containing macros incompatible with texi2mdoc?\n" ; + print FILENAME":"NR":"$0 ; + } +} + +{ + if (/TODO/) { + printf "...lines telling us what is left TODO?\n" ; + print FILENAME":"NR":"$0 ; + } + + if (/XXX/) { + printf "...lines telling us what is left to fix?\n" ; + print FILENAME":"NR":"$0 ; + } +} + +{ + if (/wether/) { + printf "...lines containing a popular typo\n" ; + print FILENAME":"NR":"$0 ; + } +} -- cgit v1.2.3 From df0af6b7067e6a4ad0a88f2775da28cfc159ee66 Mon Sep 17 00:00:00 2001 From: ng0 Date: Sun, 1 Dec 2019 23:22:26 +0000 Subject: check-texinfo.awk: move comments to the moved code. --- Makefile.am | 2 -- contrib/scripts/check-texinfo.awk.in | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'contrib/scripts/check-texinfo.awk.in') diff --git a/Makefile.am b/Makefile.am index aea6c2f6c..edcd28b92 100644 --- a/Makefile.am +++ b/Makefile.am @@ -70,7 +70,5 @@ check-python: printf "Running flake8 and 2to3 if detected.\n" $(top_srcdir)/contrib/scripts/lint/lint-python.sh || true -# exception to add: ignore license files. -# exception to add: uref's can go above 79 chars. check-texinfo: @cd $(top_srcdir); find . -type f ! -path '*/.*' -name '*.texi' -print0 | xargs -0 ./contrib/scripts/check-texinfo.awk > $(srcdir)/texinfo_lint.log || true diff --git a/contrib/scripts/check-texinfo.awk.in b/contrib/scripts/check-texinfo.awk.in index 12f71b5d2..37e2c9f20 100755 --- a/contrib/scripts/check-texinfo.awk.in +++ b/contrib/scripts/check-texinfo.awk.in @@ -1,7 +1,11 @@ #!@AWKEXE@ -f - +# # Dedicated to the Public Domain. # SPDX-License-Identifier: 0BSD +# +# exception to add: ignore license files. +# exception to add: uref's can go above 79 chars. + BEGIN { printf "Running basic texinfo linters\n" ; -- cgit v1.2.3