You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Using three-dot notation (A...B) shows only the commits in HEAD
36
+
# that aren't in upstream/main (i.e. just the PR changes).
37
+
DIFF_RANGE="upstream/main...HEAD"
38
+
39
+
# -----------------------------
40
+
# 5. Collect changed src/ files
41
+
# -----------------------------
42
+
readarray -t ALL_CHANGED_FILES <<(
43
+
git diff --name-only "$DIFF_RANGE" \
44
+
| grep '^src/' \
45
+
| grep -E '\.(ts|tsx|js|jsx)$'||true
46
+
)
16
47
17
-
# Filter out excluded directories and files
48
+
# -----------------------------
49
+
# 6. Filter excluded files/dirs
50
+
# -----------------------------
18
51
CHANGED_FILES=()
19
52
forfilein"${ALL_CHANGED_FILES[@]}";do
20
-
#Skip excluded directories
53
+
#Exclude directories
21
54
if [[ "$file"=~ ^src/(CONST|languages|setup|stories|styles|types)/ ]];then
22
-
echo"Skipping excluded directory: $file"
55
+
echo"Skipping excluded directory: \"$file\""
23
56
continue
24
57
fi
25
-
26
-
#Skip excluded files in src root
27
-
filename=$(basename "$file")
58
+
59
+
#Exclude specific files in src root
60
+
filename="$(basename "$file")"
28
61
if [[ "$filename"=~ ^(App\.tsx|CONFIG\.ts|Expensify\.tsx|HybridAppHandler\.tsx|NAICS\.ts|NAVIGATORS\.ts|ONYXKEYS\.ts|ROUTES\.ts|SCREENS\.ts|SplashScreenStateContext\.tsx|TIMEZONES\.ts)$ ]];then
29
-
echo"Skipping excluded file: $file"
62
+
echo"Skipping excluded file: \"$file\""
30
63
continue
31
64
fi
32
65
33
-
# Add to coverage collection
34
66
CHANGED_FILES+=("$file")
35
67
done
36
68
37
-
# Check if any files remain for coverage
69
+
# -----------------------------
70
+
# 7. Output results
71
+
# -----------------------------
38
72
if [ ${#CHANGED_FILES[@]}-eq 0 ];then
39
-
echo"No relevant src files changed (all changes were in excluded directories/files), skipping coverage"
0 commit comments