This adds the following: - A detect-secrets dependency and a related script (`script/detect_secrets`) to find and alert developers to secrets added to the code. By default, the script will search staged and new, unstaged files. It can optionally search only staged files. - A whitelist, `.secrets.baseline`, that tracks instances of secrets or false positives already in the repo. - Modifies `script/test` to detect secrets as part of the test suite. - Updates to the README regarding the use of detect-secrets.
32 lines
627 B
Bash
Executable File
32 lines
627 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# script/test: Run static code checks and unit tests
|
|
|
|
source "$(dirname "${0}")"/../script/include/global_header.inc.sh
|
|
|
|
export FLASK_ENV=test
|
|
|
|
# create upload directory for app
|
|
mkdir uploads | true
|
|
|
|
# Enable database resetting
|
|
RESET_DB="true"
|
|
|
|
# Define all relevant python files and directories for this app
|
|
PYTHON_FILES="./app.py ./atst/** ./config"
|
|
|
|
# Enable Python testing
|
|
RUN_PYTHON_TESTS="true"
|
|
|
|
# Enable Javascript testing
|
|
RUN_JS_TESTS="true"
|
|
|
|
# Check python formatting
|
|
source ./script/format check
|
|
|
|
# Check for secrets
|
|
./script/detect_secrets
|
|
|
|
# Run the shared test script
|
|
source ./script/include/run_test
|