gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated (545f3f9a7 -> 77b135454)


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated (545f3f9a7 -> 77b135454)
Date: Mon, 04 Mar 2019 14:52:08 +0100

This is an automated email from the git hooks/post-receive script.

ng0 pushed a change to branch master
in repository gnunet.

    from 545f3f9a7 installation: sync with readme
     new 8098bff05 Makefile: Add check-bashism top target
     new d4cea4400 Make contrib/scripts/lint-python.sh useful
     new 77b135454 Add rule to run lint-python script

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Makefile.am                    | 11 ++++++
 contrib/scripts/lint-python.sh | 82 ++++++++++++++++++++++++++++++++++--------
 2 files changed, 78 insertions(+), 15 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index fd18d7c3c..41d366b93 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -27,3 +27,14 @@ docdir = $(datadir)/doc/gnunet/
 doc_DATA = COPYING README
 
 ACLOCAL_AMFLAGS = -I m4
+
+# Check for bashisms in shell scripts
+# Very verbose, need to exclude more files.
+check-bashism:
+       printf "Run checkbashism on all .sh files.\n"
+       printf "Currently this expects checkbashism.pl at a fixed location."
+       find . -type f ! -path '*/.*' ! -path '*/_*' -name '*.sh' -print0 | 
xargs -0 ~/src/scripts/src/checkbashisms.pl -f
+
+check-python:
+       printf "Running flake8 and 2to3 if detected.\n"
+       $(top_srcdir)/contrib/scripts/lint-python.sh
diff --git a/contrib/scripts/lint-python.sh b/contrib/scripts/lint-python.sh
index 9f7e0462d..3325460f6 100755
--- a/contrib/scripts/lint-python.sh
+++ b/contrib/scripts/lint-python.sh
@@ -1,24 +1,76 @@
 #!/bin/sh
 # check python style (and 2 to 3 migration)
+#
+# behold, the worst lowest effort shell script
+# ...given that we have more generic checking
+# for executables in other scripts already
 
-rm python-lint.log
+existence()
+{
+    command -v "$1" >/dev/null 2>&1
+}
 
-if [ -e "python" ]
+# invoke from root of source!
+if [ $(basename $(pwd)) = "scripts" ]
 then
-    python --version >> python-lint.log
-fi
+   return 1
+else
+    if [ -e "python-lint.log" ]
+    then
+        rm "python-lint.log"
+    fi
 
-if [ -e "python2" ]
-then
-    python2 --version >> python-lint.log
-fi
+    if existence python;
+    then
+        python --version >> python-lint.log
+    fi
 
-if [ -e "python3" ]
-then
-    python3 --version >> python-lint.log
-fi
+    if existence python2;
+    then
+        python2 --version >> python-lint.log
+    fi
 
-flake8 >> python-lint.log
+    if existence python3;
+    then
+        python3 --version >> python-lint.log
+    fi
 
-2to3 -v -d . >> python-lint.log
-2to3 -v -p . >> python-lint.log
+    if existence python3.7;
+    then
+        python3.7 --version >> python-lint.log
+    fi
+
+    if existence flake8;
+    then
+        echo >> python-lint.log
+        echo "flake8:" >> python-lint.log
+        echo >> python-lint.log
+        flake8 >> python-lint.log
+    fi
+
+    if existence flake8-3.7;
+    then
+        echo >> python-lint.log
+        echo "flake8:" >> python-lint.log
+        echo >> python-lint.log
+        flake8-3.7 >> python-lint.log
+    fi
+
+    if existence 2to3;
+    then
+        echo >> python-lint.log
+        echo "2to3" >> python-lint.log
+        echo >> python-lint.log
+        2to3 -v -d . >> python-lint.log
+        2to3 -v -p . >> python-lint.log
+    fi
+
+    if existence 2to3-3.7;
+    then
+        echo >> python-lint.log
+        echo "2to3" >> python-lint.log
+        echo >> python-lint.log
+        2to3-3.7 -v -d . >> python-lint.log
+        2to3-3.7 -v -p . >> python-lint.log
+    fi
+fi

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]