summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-12-01 23:19:58 +0000
committerng0 <ng0@n0.is>2019-12-01 23:19:58 +0000
commitd9132e1cba66b5455a627251f377cd95eb008fc1 (patch)
treed826c9e7793e6c0161d40bc56b577448f22c653c /contrib
parent93330d9c6d8d5c599a2f12d641c5029aab91d3ad (diff)
convert texinfo checks to proper awk script, add detection for awk/gawk,
remove obsolete code.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/scripts/.gitignore1
-rw-r--r--contrib/scripts/Makefile.am12
-rwxr-xr-xcontrib/scripts/check-texinfo.awk.in55
3 files changed, 65 insertions, 3 deletions
diff --git a/contrib/scripts/.gitignore b/contrib/scripts/.gitignore
index 547c89185..3b34b9b69 100644
--- a/contrib/scripts/.gitignore
+++ b/contrib/scripts/.gitignore
@@ -1,2 +1,3 @@
gnunet-chk.py
removetrailingwhitespace.py
+check-texinfo.awk
diff --git a/contrib/scripts/Makefile.am b/contrib/scripts/Makefile.am
index 367e5c4c9..b76e57db7 100644
--- a/contrib/scripts/Makefile.am
+++ b/contrib/scripts/Makefile.am
@@ -9,7 +9,8 @@ noinst_SCRIPTS = \
removetrailingwhitespace.py \
gnunet_pyexpect.py \
gnunet_janitor.py \
- gnunet-chk.py
+ gnunet-chk.py \
+ check-texinfo.awk
bin_SCRIPTS = \
gnunet-bugreport \
@@ -24,12 +25,13 @@ EXTRA_DIST = \
$(SCRIPTS) \
removetrailingwhitespace.py.in \
pydiffer.py.in \
- gnunet-suidfix
+ gnunet-suidfix \
+ check-texinfo.awk.in
CLEANFILES = \
$(noinst_SCRIPTS)
-do_subst = $(AWK) -v py="$(PYTHON)" '{gsub("@PYTHONEXE@",py); print $$0}'
+do_subst = $(AWK) -v py="$(PYTHON)" -v awkay="$(AWK_BINARY)" '{if (/@AWKEXE@/) { gsub("@AWKEXE@",awkay)}; gsub("@PYTHONEXE@",py); print $$0}'
# Use SUFFIX Extension rules, they are more portable for every
# implementation of 'make'.
@@ -46,3 +48,7 @@ SUFFIXES = .py.in .py
.py.in.py:
$(do_subst) < $< > $@
chmod +x $@
+
+check-texinfo.awk: check-texinfo.awk.in Makefile
+ $(do_subst) < $(srcdir)/check-texinfo.awk.in > check-texinfo.awk
+ chmod +x check-texinfo.awk
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 ;
+ }
+}