Skip to content

Commit 5433e1f

Browse files
committed
Address flaws pointed out in code review
1 parent 650881b commit 5433e1f

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

check/all

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# Summary: run multiple checks on the OpenFermion code base.
18-
# This is modeled in part on Cirq's check/all script.
17+
# This script is modeled in part on Cirq's check/all script.
1918

2019
declare -r usage="\
2120
Usage: ${0##*/} [--help] [--only-changed-files] [--apply-format-changes] [BASE_REV]
@@ -49,17 +48,17 @@ function error() {
4948

5049
# ~~~~ Parse the CLI arguments and gather some data ~~~~
5150

52-
declare rev
53-
declare apply_arg
54-
declare only_changed
51+
declare -a rev=()
52+
declare -a apply_arg=()
53+
declare only_changed=""
5554
for arg in "$@"; do
5655
case "${arg}" in
5756
-h | --help)
5857
echo "${usage}"
5958
exit 0
6059
;;
6160
--apply-format-changes)
62-
apply_arg="--apply"
61+
apply_arg=( "--apply" )
6362
shift
6463
;;
6564
--only-changed-files)
@@ -94,12 +93,12 @@ if [[ -n "${only_changed}" ]]; then
9493
run check/format-incremental "${rev[@]}" "${apply_arg[@]}"
9594
run check/pylint-changed-files "${rev[@]}"
9695
else
97-
run "check/format-incremental ${rev} ${apply_arg} --all"
98-
run "check/pylint"
96+
run check/format-incremental "${rev[@]}" "${apply_arg[@]}" --all
97+
run check/pylint "${rev[@]}"
9998
fi
100-
run "check/mypy"
101-
run "check/pytest-and-incremental-coverage ${rev}"
102-
run "check/shellcheck"
99+
run check/mypy
100+
run check/pytest-and-incremental-coverage "${rev[@]}"
101+
run check/shellcheck
103102

104103
# ~~~~ Summarize the results and exit with a status code ~~~~
105104

0 commit comments

Comments
 (0)