File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -15,27 +15,27 @@ SPDX_LINE="SPDX-License-Identifier: MIT"
1515
1616check_file () {
1717 local file=$1
18+ local basename=" ${file##*/ } "
1819 local ext=" ${file##* .} "
1920 local comment_char
2021
21- # Determine comment character based on file extension
22- case " $ext " in
23- cpp|hpp|inc)
24- comment_char=" //"
25- ;;
26- py|sh|cmake)
27- comment_char=" #"
28- ;;
29- * )
30- # If the filename is *.cmake or CMakeLists.txt, use #
31- if [[ " $file " == * CMakeLists.txt ]] || [[ " $file " == * .cmake ]]; then
22+ # Determine comment character based on filename or extension
23+ if [[ " $basename " == " CMakeLists.txt" ]]; then
24+ comment_char=" #"
25+ else
26+ case " $ext " in
27+ cpp|hpp|inc)
28+ comment_char=" //"
29+ ;;
30+ py|sh|cmake)
3231 comment_char=" #"
33- else
32+ ;;
33+ * )
3434 # Skip files with unsupported extensions
3535 return 0
36- fi
37- ;;
38- esac
36+ ;;
37+ esac
38+ fi
3939
4040 # Build expected header patterns
4141 expected_copyright=" $comment_char $COPYRIGHT_LINE "
You can’t perform that action at this time.
0 commit comments