From ea218e250650629e753acd26a04c5a4edc074944 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 11 Jul 2019 10:19:03 +0200 Subject: [PATCH 1/7] List of all repositories that needs to be checked --- directories.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 directories.txt diff --git a/directories.txt b/directories.txt new file mode 100644 index 00000000..2f77526f --- /dev/null +++ b/directories.txt @@ -0,0 +1,3 @@ +f8a_jobs +tests +tools From b66084c17a0a9259b11cc4b62e59f821fca9d815 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 11 Jul 2019 10:19:03 +0200 Subject: [PATCH 2/7] List of all separate files that needs to be checked --- files.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 files.txt diff --git a/files.txt b/files.txt new file mode 100644 index 00000000..e3f8e8ca --- /dev/null +++ b/files.txt @@ -0,0 +1,2 @@ +f8a-jobs.py +setup.py From 26ac9e16dfbfc1045971b9b7e2eaa3aa227fb18d Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 11 Jul 2019 10:19:03 +0200 Subject: [PATCH 3/7] Update the script check-docstyle.sh to use directories.txt --- check-docstyle.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/check-docstyle.sh b/check-docstyle.sh index 60027bf2..ee3d3958 100755 --- a/check-docstyle.sh +++ b/check-docstyle.sh @@ -1,15 +1,21 @@ #!/bin/bash -directories="f8a_jobs tests tools" -separate_files="f8a-jobs.py setup.py" +IFS=$'\n' + +# list of directories with sources to check +directories=$(cat directories.txt) + +# list of separate files to check +separate_files=$(cat files.txt) + pass=0 fail=0 function prepare_venv() { - VIRTUALENV=$(which virtualenv) + VIRTUALENV="$(which virtualenv)" if [ $? -eq 1 ]; then # python36 which is in CentOS does not have virtualenv binary - VIRTUALENV=$(which virtualenv-3) + VIRTUALENV="$(which virtualenv-3)" fi ${VIRTUALENV} -p python3 venv && source venv/bin/activate && python3 "$(which pip3)" install pydocstyle From 84237cb84cb1a48d5e40a27edcda4f8c883cc35e Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 11 Jul 2019 10:19:03 +0200 Subject: [PATCH 4/7] Update the script detect-common-errors.sh to use directories.txt --- detect-common-errors.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/detect-common-errors.sh b/detect-common-errors.sh index ed193651..3a1401b7 100755 --- a/detect-common-errors.sh +++ b/detect-common-errors.sh @@ -1,16 +1,21 @@ #!/bin/bash -directories="f8a_jobs tests tools" -separate_files="f8a-jobs.py setup.py" +IFS=$'\n' + +# list of directories with sources to check +directories=$(cat directories.txt) + +# list of separate files to check +separate_files=$(cat files.txt) pass=0 fail=0 function prepare_venv() { - VIRTUALENV=$(which virtualenv) + VIRTUALENV="$(which virtualenv)" if [ $? -eq 1 ]; then # python36 which is in CentOS does not have virtualenv binary - VIRTUALENV=$(which virtualenv-3) + VIRTUALENV="$(which virtualenv-3)" fi ${VIRTUALENV} -p python3 venv && source venv/bin/activate && python3 "$(which pip3)" install pyflakes From 4691bee65a2c3888ba6b5badf78319fd251f64f6 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 11 Jul 2019 10:19:03 +0200 Subject: [PATCH 5/7] Update the script detect-dead-code.sh to use directories.txt --- detect-dead-code.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/detect-dead-code.sh b/detect-dead-code.sh index 44e73cf4..2b9bd958 100755 --- a/detect-dead-code.sh +++ b/detect-dead-code.sh @@ -1,16 +1,21 @@ #!/bin/bash -directories="f8a_jobs tests tools" -separate_files="f8a-jobs.py setup.py" +IFS=$'\n' + +# list of directories with sources to check +directories=$(cat directories.txt) + +# list of separate files to check +separate_files=$(cat files.txt) pass=0 fail=0 function prepare_venv() { - VIRTUALENV=$(which virtualenv) + VIRTUALENV="$(which virtualenv)" if [ $? -eq 1 ]; then # python36 which is in CentOS does not have virtualenv binary - VIRTUALENV=$(which virtualenv-3) + VIRTUALENV="$(which virtualenv-3)" fi ${VIRTUALENV} -p python3 venv && source venv/bin/activate && python3 "$(which pip3)" install vulture From 6182e41e23caccfc4a82a12e3b27007e6e4863d2 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 11 Jul 2019 10:19:03 +0200 Subject: [PATCH 6/7] Update the script run-linter.sh to use directories.txt --- run-linter.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/run-linter.sh b/run-linter.sh index b082660c..f0e12d06 100755 --- a/run-linter.sh +++ b/run-linter.sh @@ -1,16 +1,21 @@ #!/bin/bash -directories="f8a_jobs tests tools" -separate_files="f8a-jobs.py setup.py" +IFS=$'\n' + +# list of directories with sources to check +directories=$(cat directories.txt) + +# list of separate files to check +separate_files=$(cat files.txt) pass=0 fail=0 function prepare_venv() { - VIRTUALENV=$(which virtualenv) + VIRTUALENV="$(which virtualenv)" if [ $? -eq 1 ]; then # python36 which is in CentOS does not have virtualenv binary - VIRTUALENV=$(which virtualenv-3) + VIRTUALENV="$(which virtualenv-3)" fi ${VIRTUALENV} -p python3 venv && source venv/bin/activate && python3 "$(which pip3)" install pycodestyle From 6e629dda6315df3ae11bef4ff0baa04ef51c44d4 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 11 Jul 2019 10:19:03 +0200 Subject: [PATCH 7/7] Update documentation --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index c01289e1..6308ba33 100644 --- a/README.md +++ b/README.md @@ -504,6 +504,8 @@ The first script checks the indentation, line lengths, variable names, white spa script checks all documentation strings - its presence and format. Please fix any warnings and errors reported by these scripts. +List of directories containing source code, that needs to be checked, are stored in a file `directories.txt` + #### Code complexity measurement The scripts `measure-cyclomatic-complexity.sh` and `measure-maintainability-index.sh` are used to measure code complexity. These scripts can be run w/o any arguments: @@ -531,6 +533,8 @@ Please note that due to Python's dynamic nature, static code analyzers are likel Because of this potential problems, only code detected with more than 90% of confidence is reported. +List of directories containing source code, that needs to be checked, are stored in a file `directories.txt` + #### Common issues detection The script `detect-common-errors.sh` can be used to detect common errors in the repository. This script can be run w/o any arguments: @@ -541,6 +545,8 @@ The script `detect-common-errors.sh` can be used to detect common errors in the Please note that only semantical problems are reported. +List of directories containing source code, that needs to be checked, are stored in a file `directories.txt` + #### Check for scripts written in BASH The script named `check-bashscripts.sh` can be used to check all BASH scripts (in fact: all files with the `.sh` extension) for various possible issues, incompatibilities, and caveats. This script can be run w/o any arguments: