Skip to content

Commit

Permalink
Merge pull request #369 from tisnik/fix-issue-368
Browse files Browse the repository at this point in the history
QA script use directories.txt
  • Loading branch information
tisnik authored Jul 11, 2019
2 parents de1e368 + 6e629dd commit b2af30c
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 16 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
14 changes: 10 additions & 4 deletions check-docstyle.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 9 additions & 4 deletions detect-common-errors.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 9 additions & 4 deletions detect-dead-code.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions directories.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
f8a_jobs
tests
tools
2 changes: 2 additions & 0 deletions files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
f8a-jobs.py
setup.py
13 changes: 9 additions & 4 deletions run-linter.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit b2af30c

Please sign in to comment.