File tree 1 file changed +12
-8
lines changed
1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,17 @@ web_modified=false
9
9
10
10
for file in $files
11
11
do
12
- if [[ $file == " api/" * && $file == * .py ]]; then
13
- # set api_modified flag to true
14
- api_modified=true
15
- elif [[ $file == " web/" * ]]; then
16
- # set web_modified flag to true
17
- web_modified=true
18
- fi
12
+ # Use POSIX compliant pattern matching
13
+ case " $file " in
14
+ api/* .py)
15
+ # set api_modified flag to true
16
+ api_modified=true
17
+ ;;
18
+ web/* )
19
+ # set web_modified flag to true
20
+ web_modified=true
21
+ ;;
22
+ esac
19
23
done
20
24
21
25
# run linters based on the modified modules
@@ -24,7 +28,7 @@ if $api_modified; then
24
28
echo " Running Ruff linter on api module"
25
29
26
30
# python style checks rely on `ruff` in path
27
- if ! command -v ruff & > /dev/null; then
31
+ if ! command -v ruff > /dev/null 2>&1 ; then
28
32
echo " Installing linting tools (Ruff, dotenv-linter ...) ..."
29
33
poetry install -C api --only lint
30
34
fi
You can’t perform that action at this time.
0 commit comments