Skip to content

Commit c4dbb77

Browse files
Fix ty workflow to properly handle test files
1 parent 6f5be5c commit c4dbb77

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/ty.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,18 @@ jobs:
4242
if: ${{ env.python_files != '' }}
4343
run: |
4444
echo "Running ty on changed files: ${{ env.python_files }}"
45-
uv run ty check --output-format concise --python-version 3.12 --exclude "**/tests/**" --exclude "**/codegen_tests/**" ${{ env.python_files }}
45+
# Filter out test files for type checking
46+
src_files=()
47+
for file in ${{ env.python_files }}; do
48+
if [[ ! $file == *"/tests/"* && ! $file == *"/codegen_tests/"* ]]; then
49+
src_files+=("${file}")
50+
fi
51+
done
52+
53+
# Only run type checking if there are source files to check
54+
if [ ${#src_files[@]} -gt 0 ]; then
55+
echo "Running ty on source files: ${src_files[*]}"
56+
uv run ty check --output-format concise --python-version 3.12 ${src_files[@]}
57+
else
58+
echo "No source files to check, skipping ty"
59+
fi

0 commit comments

Comments
 (0)