Skip to content

Commit 91cc0a1

Browse files
committed
tools: exclude non-project files from go version consistency lint check
1 parent cd916e7 commit 91cc0a1

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tools/check-go-version-dockerfile.sh

+9
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,17 @@ target_go_version="$1"
2828
# Search for Dockerfiles in the current directory and its subdirectories
2929
dockerfiles=$(find . -type f -name "*.Dockerfile" -o -name "Dockerfile")
3030

31+
# Exclude non-project files.
32+
exclusions=(./vendor)
33+
exclusion_pattern=$(IFS="|" ; echo "${exclusions[*]}")
34+
3135
# Check each Dockerfile
3236
for file in $dockerfiles; do
37+
# Skip excluded files
38+
if echo "$file" | grep -qE "$exclusion_pattern"; then
39+
continue
40+
fi
41+
3342
check_go_version "$file" "$target_go_version"
3443
done
3544

tools/check-go-version-yaml.sh

+9
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,17 @@ target_go_version="$1"
3939
# Search for YAML files in the current directory and its subdirectories
4040
yaml_files=$(find . -type f -name "*.yaml" -o -name "*.yml")
4141

42+
# Exclude non-project files.
43+
exclusions=(./vendor)
44+
exclusion_pattern=$(IFS="|" ; echo "${exclusions[*]}")
45+
4246
# Check each YAML file
4347
for file in $yaml_files; do
48+
# Skip excluded files
49+
if echo "$file" | grep -qE "$exclusion_pattern"; then
50+
continue
51+
fi
52+
4453
check_go_version "$file" "$target_go_version"
4554
done
4655

0 commit comments

Comments
 (0)