File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 6363
6464target_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.
6785yaml_files=$( find . -type f \( -name " *.yaml" -o -name " *.yml" \) )
6886
6987# Check each YAML file.
7088for 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 "
7397done
You can’t perform that action at this time.
0 commit comments