From a5f1cd91975e8d592df534f75481411b67837e30 Mon Sep 17 00:00:00 2001 From: Andris Raugulis Date: Thu, 20 Oct 2016 20:00:29 +0300 Subject: [PATCH] Tune prospector and pylint settings. --- test/prospector.sh | 7 ++++++- test/prospector.yml | 45 +++++++++++++++++++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/test/prospector.sh b/test/prospector.sh index e420aff..4398ec7 100755 --- a/test/prospector.sh +++ b/test/prospector.sh @@ -5,4 +5,9 @@ if [ $? -ne 0 ]; then echo "err: prospector (Python Static Analysis) not found." exit 1 fi -prospector --profile-path "${_cdir}" -P prospector "${_cdir}/../ssh-audit.py" +if [ X"$1" == X"" ]; then + _file="${_cdir}/../ssh-audit.py" +else + _file="$1" +fi +prospector -E --profile-path "${_cdir}" -P prospector "${_file}" diff --git a/test/prospector.yml b/test/prospector.yml index f3373b7..474af15 100644 --- a/test/prospector.yml +++ b/test/prospector.yml @@ -1,9 +1,42 @@ -inherits: - - strictness_veryhigh +strictness: veryhigh +doc-warnings: false + +pylint: + disable: + - multiple-imports + - invalid-name + - trailing-whitespace + + options: + max-args: 8 # default: 5 + max-locals: 20 # default: 15 + max-returns: 6 + max-branches: 15 # default: 12 + max-statements: 60 # default: 50 + max-parents: 7 + max-attributes: 8 # default: 7 + min-public-methods: 1 # default: 2 + max-public-methods: 20 + max-bool-expr: 5 + max-nested-blocks: 6 # default: 5 + max-line-length: 80 # default: 100 + ignore-long-lines: ^\s*(#\s+type:\s+.*|[A-Z0-9_]+\s+=\s+.*|('.*':\s+)?\[.*\],?)$ + max-module-lines: 2500 # default: 10000 pep8: disable: - - W191 - - W293 - - E501 - - E221 + - W191 # indentation contains tabs + - W293 # blank line contains whitespace + - E101 # indentation contains mixed spaces and tabs + - E401 # multiple imports on one line + - E501 # line too long + - E221 # multiple spaces before operator + +pyflakes: + disable: + - F401 # module imported but unused + - F821 # undefined name + +mccabe: + options: + max-complexity: 15