From 3057d2604735364089fd67d8ddc0640f75fc8e9e Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 25 Jul 2019 09:46:50 +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 0000000..72ad463 --- /dev/null +++ b/directories.txt @@ -0,0 +1,3 @@ +f8a_report +tests +tools From 580468cabdbe9f449b3d82723ceae03f5bf30e65 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 25 Jul 2019 09:46:50 +0200 Subject: [PATCH 2/7] List of all separate files that needs to be checked --- files.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 files.txt diff --git a/files.txt b/files.txt new file mode 100644 index 0000000..659ddbf --- /dev/null +++ b/files.txt @@ -0,0 +1 @@ +setup.py From 8852db63032687bbb710930b2f3cfab86257d20f Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 25 Jul 2019 09:46:50 +0200 Subject: [PATCH 3/7] Update the script check-docstyle.sh to use directories.txt --- check-docstyle.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/check-docstyle.sh b/check-docstyle.sh index cfb5cd9..7b4d3bb 100755 --- a/check-docstyle.sh +++ b/check-docstyle.sh @@ -1,7 +1,13 @@ #!/bin/bash -directories="f8a_report tests tools" -separate_files="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 From 567d3618aea0b11ab04045682de9697e84f1e4b2 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 25 Jul 2019 09:46:50 +0200 Subject: [PATCH 4/7] Update the script detect-common-errors.sh to use directories.txt --- detect-common-errors.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/detect-common-errors.sh b/detect-common-errors.sh index 5917e7c..a7eaad3 100755 --- a/detect-common-errors.sh +++ b/detect-common-errors.sh @@ -1,7 +1,12 @@ #!/bin/bash -directories="f8a_report tools tests" -separate_files="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 From 6a299e85eb38ecfde2e7de5b556e95421e5dd7d7 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 25 Jul 2019 09:46:50 +0200 Subject: [PATCH 5/7] Update the script detect-dead-code.sh to use directories.txt --- detect-dead-code.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/detect-dead-code.sh b/detect-dead-code.sh index 39579fc..45f86b7 100755 --- a/detect-dead-code.sh +++ b/detect-dead-code.sh @@ -1,7 +1,12 @@ #!/bin/bash -directories="f8a_report tools" -separate_files="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 From 4dc6cc0360a53aeb0baed2efb9bb2c421e57843b Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 25 Jul 2019 09:46:50 +0200 Subject: [PATCH 6/7] Update the script run-linter.sh to use directories.txt --- run-linter.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/run-linter.sh b/run-linter.sh index a67398d..3c06538 100755 --- a/run-linter.sh +++ b/run-linter.sh @@ -1,7 +1,13 @@ #!/bin/bash -directories="f8a_report tests tools" -separate_files="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 @@ -51,7 +57,7 @@ done echo echo "----------------------------------------------------" echo "Running Python linter against selected files:" -echo $separate_files +echo "$separate_files" echo "----------------------------------------------------" # check for individual files From 01100a7a220d89b908387a5b4746d789f78b90b3 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Thu, 25 Jul 2019 09:46:50 +0200 Subject: [PATCH 7/7] Update documentation --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index bcd7c44..d7f28e4 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,8 @@ The first script checks the indentation, line lengths, variable names, whitespac 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: @@ -109,6 +111,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: @@ -119,6 +123,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: