[riot-notifications] [RIOT-OS/RIOT] tools/ci: correcly report flake8 version. (#10252)

Juan I Carrano notifications at github.com
Mon Jan 7 14:53:25 CET 2019


jcarrano commented on this pull request.



> @@ -5,21 +5,17 @@ get_cmd_version() {
         return
     fi
 
-    local cmd="$1"
-    if command -v "$cmd" 2>&1 >/dev/null; then
-        ver=$("$cmd" --version 2> /dev/null | head -n 1)
-        # some tools (eg. openocd) print version info to stderr
-        if [ -z "$ver" ]; then
-            ver=$("$cmd" --version 2>&1 | head -n 1)
-        fi
-        if [ -z "$ver" ]; then
-            ver="error"
-        fi
-    else
-        ver="missing"
+    VERSION_RAW=$( ($@ --version) 2>&1)

That is because your version of `pycodestyle` is old. I can reproduce the issue myself if I force the installation of those versions via PIP.

In any case, if I change the behaviour I'd fix it, but I'd rather handle that case by case, see my comment below.

>  done
+printf "%23s: %s\n" "flake8" "$(get_cmd_version "python3 -m flake8")"

@smlng This should make the warning go away:

```suggestion
printf "%23s: %s\n" "flake8" "$(get_cmd_version "python3 -Wignore -m flake8")"
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10252#pullrequestreview-189812342
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190107/981759ac/attachment.html>


More information about the notifications mailing list