Skip to content

Commit a5eb8ff

Browse files
committed
scripts: exclude ./itest/chantools from YAML Go version linter
After running integration tests locally, the chantools repo is pulled, causing the linter to mistakenly analyze that repo. This commit updates the linter exclusion list to prevent this issue.
1 parent add6bb4 commit a5eb8ff

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

scripts/check-go-version-yaml.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,35 @@ fi
6363

6464
target_go_version="$1"
6565

66+
# File paths to be excluded from the check.
67+
exception_list=(
68+
# Exclude chantools files as they are not in this project.
69+
"./itest/chantools/.golangci.yml"
70+
"./itest/chantools/.github/workflows/main.yml"
71+
)
72+
73+
# is_exception checks if a file is in the exception list.
74+
is_exception() {
75+
local file="$1"
76+
for exception in "${exception_list[@]}"; do
77+
if [ "$file" == "$exception" ]; then
78+
return 0
79+
fi
80+
done
81+
return 1
82+
}
83+
6684
# Search for YAML files in the current directory and its subdirectories.
6785
yaml_files=$(find . -type f \( -name "*.yaml" -o -name "*.yml" \))
6886

6987
# Check each YAML file.
7088
for file in $yaml_files; do
89+
# Skip the file if it is in the exception list.
90+
if is_exception "$file"; then
91+
echo "Skipping $file"
92+
continue
93+
fi
94+
7195
check_go_version_yaml "$file" "$target_go_version"
7296
check_go_version_env_variable "$file" "$target_go_version"
7397
done

0 commit comments

Comments
 (0)