aboutsummaryrefslogtreecommitdiff
path: root/contrib/scripts/lint
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-04-01 14:23:46 +0000
committerng0 <ng0@n0.is>2019-04-01 14:23:46 +0000
commitae004979659f80756076e2fe65888437a634533f (patch)
tree11760fd8e1267954d081337f6036bf5f39cb68e7 /contrib/scripts/lint
parent3b1b7c03ea0c92ff15f7a0d3b76fe0a312a24b25 (diff)
downloadgnunet-ae004979659f80756076e2fe65888437a634533f.tar.gz
gnunet-ae004979659f80756076e2fe65888437a634533f.zip
rename files
Diffstat (limited to 'contrib/scripts/lint')
-rwxr-xr-xcontrib/scripts/lint/lint-man.sh38
-rwxr-xr-xcontrib/scripts/lint/lint-python.sh79
2 files changed, 117 insertions, 0 deletions
diff --git a/contrib/scripts/lint/lint-man.sh b/contrib/scripts/lint/lint-man.sh
new file mode 100755
index 000000000..8915e9ece
--- /dev/null
+++ b/contrib/scripts/lint/lint-man.sh
@@ -0,0 +1,38 @@
1#!/bin/sh
2#
3# SPDX-License-Identifier: 0BSD
4# spit out ONLY error messages using groff.
5
6existence()
7{
8 command -v "$1" >/dev/null 2>&1
9}
10
11if existence groff;
12then
13 echo "groff check"
14 for f in `find . -name \*\.[1-9]`;
15 do
16 LC_ALL=en_US.UTF-8 \
17 MANROFFSEQ='' \
18 MANWIDTH=80 \
19 groff -m mandoc -b -z -w w $f;
20 done
21 # FIXME below, grande stupidity.
22 rm groff_lint.log
23 echo "Wrong use of B"
24 for f in `find . -name \*\.[1-9]`;
25 do
26 awk '/^\.B$/ {print FILENAME":"NR":"$0}' $f >> groff_lint.log || true
27 done
28fi
29
30echo "mandoc check"
31# spit out ONLY error messages with mandoc:
32if existence mandoc;
33then
34 mandoc -T lint `find . -name \*\.[1-9]`
35fi
36
37#LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 /run/current-system/profile/bin/man --warnings -E UTF-8 -l -Tutf8 -Z <*.5> >report5.log
38#LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 /run/current-system/profile/bin/man --warnings -E UTF-8 -l -Tutf8 -Z <*.1> >report1.log
diff --git a/contrib/scripts/lint/lint-python.sh b/contrib/scripts/lint/lint-python.sh
new file mode 100755
index 000000000..0e46719ff
--- /dev/null
+++ b/contrib/scripts/lint/lint-python.sh
@@ -0,0 +1,79 @@
1#!/bin/sh
2# check python style (and 2 to 3 migration)
3#
4# behold, the worst lowest effort shell script
5# ...given that we have more generic checking
6# for executables in other scripts already
7
8existence()
9{
10 command -v "$1" >/dev/null 2>&1
11}
12
13# It is assumed that you are in 'lint'.
14LOGFILE="python-lint.log"
15
16# invoke from root of source!
17if [ $(basename $(pwd)) = "scripts" ]
18then
19 return 1
20else
21 if [ -e "${LOGFILE}" ]
22 then
23 rm ${LOGFILE}
24 fi
25
26 if existence python;
27 then
28 python --version >> ${LOGFILE}
29 fi
30
31 if existence python2;
32 then
33 python2 --version >> ${LOGFILE}
34 fi
35
36 if existence python3;
37 then
38 python3 --version >> ${LOGFILE}
39 fi
40
41 if existence python3.7;
42 then
43 python3.7 --version >> ${LOGFILE}
44 fi
45
46 if existence flake8;
47 then
48 echo >> ${LOGFILE}
49 echo "flake8:" >> ${LOGFILE}
50 echo >> ${LOGFILE}
51 flake8 >> ${LOGFILE}
52 fi
53
54 if existence flake8-3.7;
55 then
56 echo >> ${LOGFILE}
57 echo "flake8:" >> ${LOGFILE}
58 echo >> ${LOGFILE}
59 flake8-3.7 >> ${LOGFILE}
60 fi
61
62 if existence 2to3;
63 then
64 echo >> ${LOGFILE}
65 echo "2to3" >> ${LOGFILE}
66 echo >> ${LOGFILE}
67 2to3 -v -d . >> ${LOGFILE}
68 2to3 -v -p . >> ${LOGFILE}
69 fi
70
71 if existence 2to3-3.7;
72 then
73 echo >> ${LOGFILE}
74 echo "2to3" >> ${LOGFILE}
75 echo >> ${LOGFILE}
76 2to3-3.7 -v -d . >> ${LOGFILE}
77 2to3-3.7 -v -p . >> ${LOGFILE}
78 fi
79fi