File tree 8 files changed +71
-53
lines changed
8 files changed +71
-53
lines changed Original file line number Diff line number Diff line change 2
2
3
3
set -euo pipefail
4
4
5
- function check_single()
6
- {
7
- declare -r in_path=" $1 "
8
- declare -i result_val=0
9
- printf " Checking \" %s\" \n" " ${in_path} "
10
- printf " Checking with pylint:\n"
11
- if ! poetry run pylint " $in_path " ; then
12
- result_val=1
13
- fi
14
-
15
- printf " Checking with flake8:\n"
16
- if ! poetry run flake8 " $in_path " --count --max-line-length=80 --show-source ; then
17
- result_val=1
18
- fi
19
- printf " ...done\n\n\n"
20
- return $result_val
21
- }
22
-
23
-
24
- declare -i exit_code=0
25
-
26
- while IFS=" " read -r cur_script
27
- do
28
- if ! check_single " $cur_script " ; then
29
- exit_code=1
30
- fi
31
- done < <( find . -name " *.py" -not -path " ./tests/example_data/python3/*" )
32
-
33
- exit $exit_code
5
+ find . -name " *.py" -not -path " ./tests/example_data/python3/*" -exec ./check_python_file.sh {} +
Original file line number Diff line number Diff line change 2
2
3
3
set -euo pipefail
4
4
5
- declare -i exit_code=0
6
-
7
- while IFS=" " read -r cur_script
8
- do
9
- printf " Checking \" %s\" \n" " ${cur_script} "
10
- if ! shellcheck " $cur_script " ; then
11
- exit_code=1
12
- fi
13
- if ! grep -q " set -euo pipefail" " $cur_script " ; then
14
- printf " add \" set -euo pipefail\" \n"
15
- exit_code=1
16
- fi
17
- done < <( find . -name " *.sh" )
18
-
19
- exit $exit_code
5
+ find . -name " *.sh" -exec ./check_shell_script.sh {} +
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ declare -i exit_code=0
6
+
7
+ for cur_file in " $@ "
8
+ do
9
+ printf " Checking \" %s\" \n" " ${cur_file} "
10
+ printf " Checking with pylint:\n"
11
+ if ! poetry run pylint " ${cur_file} " ; then
12
+ exit_code=1
13
+ fi
14
+
15
+ printf " Checking with flake8:\n"
16
+ if ! poetry run flake8 " ${cur_file} " --count --max-line-length=80 --show-source ; then
17
+ exit_code=1
18
+ fi
19
+ done
20
+
21
+ if [[ ${exit_code} -eq 0 ]] ; then
22
+ printf " \nNo errors found!\n"
23
+ fi
24
+
25
+ exit " ${exit_code} "
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ declare -i exit_code=0
6
+
7
+ for cur_script in " $@ "
8
+ do
9
+ printf " Checking \" %s\" \n" " ${cur_script} "
10
+ if ! shellcheck " ${cur_script} " --enable=all; then
11
+ exit_code=1
12
+ fi
13
+ if ! grep -q " set -euo pipefail" " ${cur_script} " ; then
14
+ printf " add \" set -euo pipefail\" \n"
15
+ exit_code=1
16
+ fi
17
+ done
18
+
19
+ if [[ ${exit_code} -eq 0 ]] ; then
20
+ printf " \nNo errors found!\n"
21
+ fi
22
+ exit " ${exit_code} "
Original file line number Diff line number Diff line change 2
2
3
3
set -euo pipefail
4
4
5
- while IFS=" " read -r cur_script
6
- do
7
- python3 " $cur_script "
8
- done < <( find . -name " example_*.py" )
5
+ find . -name " example_*.py" -exec ./run_python_file.sh {} +
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ declare -i exit_code=0
6
+
7
+ for cur_file in " $@ "
8
+ do
9
+ if ! poetry run python3 " ${cur_file} " ; then
10
+ exit_code=1
11
+ fi
12
+ done
13
+
14
+ if [[ ${exit_code} -eq 0 ]] ; then
15
+ printf " \nNo errors found!\n"
16
+ fi
17
+
18
+ exit " ${exit_code} "
Original file line number Diff line number Diff line change 2
2
3
3
set -euo pipefail
4
4
5
- while IFS=" " read -r cur_script
6
- do
7
- ./" $cur_script "
8
- done < <( find . -name " setup_for_*.sh" )
5
+
6
+ find . -name " setup_for_*.sh" -exec ./{} \;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ set -euo pipefail
4
4
5
5
status=$( curl -s -X POST --data-binary @codecov.yml https://codecov.io/validate)
6
6
printf " %s\n" " ${status} "
7
- if [[ $status == * Error* ]];
7
+ if [[ ${ status} == * Error* ]];
8
8
then
9
9
exit 1
10
10
fi
You can’t perform that action at this time.
0 commit comments