summaryrefslogtreecommitdiff
path: root/tools/run-flake8
diff options
context:
space:
mode:
authorShreenidhi Shedi <53473811+sshedi@users.noreply.github.com>2021-09-01 19:53:55 +0530
committerGitHub <noreply@github.com>2021-09-01 09:23:55 -0500
commit58c2de4c97de6cfa6edbf5319641f2ef71284895 (patch)
tree3f8806eeb1e61a408f85f48b9a07d85b981acf50 /tools/run-flake8
parent76cff793840be63a69a74293170122c189ebaead (diff)
downloadvyos-cloud-init-58c2de4c97de6cfa6edbf5319641f2ef71284895.tar.gz
vyos-cloud-init-58c2de4c97de6cfa6edbf5319641f2ef71284895.zip
Fix `make style-check` errors (#1000)
Using flake8 inplace of pyflakes Renamed run-pyflakes -> run-flake8 Changed target name to flake8 in Makefile With pyflakes we can't suppress warnings/errors in few required places. flake8 is flexible in that regard. Hence using flake8 seems to be a better choice here. flake8 does the job of pep8 anyway. So, removed pep8 target from Makefile along with tools/run-pep8 script. Included setup.py in flake8 checks
Diffstat (limited to 'tools/run-flake8')
-rwxr-xr-xtools/run-flake817
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/run-flake8 b/tools/run-flake8
new file mode 100755
index 00000000..0021cdb9
--- /dev/null
+++ b/tools/run-flake8
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+CR="
+"
+pycheck_dirs=( "cloudinit/" "tests/" "tools/" "setup.py" )
+
+set -f
+if [ $# -eq 0 ]; then
+ files=( "${pycheck_dirs[@]}" )
+else
+ files=( "$@" )
+fi
+
+cmd=( "python3" -m "flake8" "${files[@]}" )
+
+echo "Running: " "${cmd[@]}" 1>&2
+exec "${cmd[@]}"