@@ -49,24 +49,24 @@ jobs:
4949 filename=$(basename "$file")
5050 dir=$(dirname "$file")
5151
52- # Check for proper naming conventions
52+ # Check for proper naming conventions (Allow snake_case, camelCase, or PascalCase)
5353 case "$file" in
5454 *.c|*.cpp|*.py)
55- # Should use snake_case
56- if [[ ! "$filename" =~ ^[a-z0 -9_]+\.[a-z]+$ ]]; then
57- invalid_files+=("$file: Should use snake_case (e.g., binary_search.cpp)")
55+ # Allow snake_case, camelCase, or PascalCase for C/C++/Python
56+ if [[ ! "$filename" =~ ^[a-zA-Z0 -9_]+\.[a-z]+$ ]]; then
57+ invalid_files+=("$file: Use alphanumeric characters and underscores only (e.g., binary_search.cpp, maxRectangle .cpp)")
5858 fi
5959 ;;
6060 *.java)
61- # Should use PascalCase
61+ # Should use PascalCase for Java classes
6262 if [[ ! "$filename" =~ ^[A-Z][a-zA-Z0-9]*\.java$ ]]; then
63- invalid_files+=("$file: Should use PascalCase (e.g., BinarySearch.java)")
63+ invalid_files+=("$file: Java files should use PascalCase (e.g., BinarySearch.java, MaxRectangle .java)")
6464 fi
6565 ;;
6666 *.js|*.ts|*.go|*.rs|*.kt|*.swift|*.php|*.rb|*.cs|*.dart|*.scala)
67- # Language-specific naming (mostly snake_case or camelCase)
68- if [[ ! "$filename" =~ ^[a-z][a- zA-Z0-9_]* \.[a-z]+$ ]]; then
69- invalid_files+=("$file: Should follow language conventions ")
67+ # Allow flexible naming for other languages
68+ if [[ ! "$filename" =~ ^[a-zA-Z0-9_]+ \.[a-z]+$ ]]; then
69+ invalid_files+=("$file: Use alphanumeric characters and underscores only ")
7070 fi
7171 ;;
7272 esac
0 commit comments