Skip to content

Commit 3d2bd03

Browse files
authored
Merge pull request #1375 from lightninglabs/skip-linting-chantools
scripts: exclude ./itest/chantools from YAML Go version linter
2 parents add6bb4 + a5eb8ff commit 3d2bd03

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)