New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix quoting in shell scripts per shellcheck-0.9 #6245
Conversation
Fix instances of `SC2086: Double quote to prevent globbing and word splitting`. Ref: https://www.shellcheck.net/wiki/SC2086
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #6245 +/- ##
======================================
Coverage 97.3% 97.3%
======================================
Files 1116 1116
Lines 96174 96076 -98
======================================
- Hits 93654 93563 -91
+ Misses 2520 2513 -7
☔ View full report in Codecov by Sentry. |
#!/usr/bin/env bash Finds changed lines not covered by tests related to changed files.Usage:check/pytest-and-incremental-coverage [BASE_REVISION]Get the working directory to the repo root.cd "$( dirname "${BASH_SOURCE[0]}" )" || exit 1 Determine which revision to compare against.if [ -n "$1" ] && [[ $1 != -* ]]; then source dev_tools/pypath Run tests while producing coverage files.check/pytest --cov Analyze coverage JSON files.python dev_tools/check_incremental_coverage_json.py "${rev}" Clean up generated coverage JSON report.git clean --force --quiet -x -- "*.json" Report result.if [ "${pytest_result}" -ne "0" ] || [ "${cover_result}" -ne "0" ]; then #!/usr/bin/env bash Finds changed lines not covered by tests related to changed files.Usage:check/pytest-and-incremental-coverage [BASE_REVISION]Get the working directory to the repo root.cd "$( dirname "${BASH_SOURCE[0]}" )" || exit 1 Determine which revision to compare against.if [ -n "$1" ] && [[ $1 != -* ]]; then source dev_tools/pypath Run tests while producing coverage files.check/pytest --cov Analyze coverage JSON files.python dev_tools/check_incremental_coverage_json.py "${rev}" Clean up generated coverage JSON report.git clean --force --quiet -x -- "*.json" Report result.if [ "${pytest_result}" -ne "0" ] || [ "${cover_result}" -ne "0" ]; then #!/usr/bin/env bash Finds changed lines not covered by tests related to changed files.Usage:check/pytest-changed-files-and-incremental-coverage [BASE_REVISION]Get the working directory to the repo root.cd "$( dirname "${BASH_SOURCE[0]}" )" || exit 1 Initialize variablesPYTEST_ARGS=() Check for base revision and pytest argumentsif [[ "$1" == [^-]* ]]; then for arg in "$@"; do Determine which revision to compare against.if [ -n "${BASEREV}" ]; then source dev_tools/pypath Run tests while producing coverage files using pytest and coverage configurations.check/pytest --cov Assume successful cover_result in case coverage is not run.cover_result=0
fi Report the final result.if (( pytest_result || cover_result )); then [tool.black] [tool.pytest.ini_options] [tool.coverage.run] Omit files outside the current working directory.Note: this means coverage must be run from the cirq repo root.Failure to do so will result in false positives.include = "./" |
@davidmerwin - can you please clarify your comment above? |
Fix instances of
SC2086: Double quote to prevent globbing and word splitting
.Ref: https://www.shellcheck.net/wiki/SC2086