File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4949 filename=$(basename "$file")
5050 dir=$(dirname "$file")
5151
52- # Check for proper naming conventions (Allow snake_case, camelCase, or PascalCase)
53- case "$file" in
54- *.c|*.cpp|*.py)
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)")
58- fi
59- ;;
60- *.java)
61- # Should use PascalCase for Java classes
62- if [[ ! "$filename" =~ ^[A-Z][a-zA-Z0-9]*\.java$ ]]; then
63- invalid_files+=("$file: Java files should use PascalCase (e.g., BinarySearch.java, MaxRectangle.java)")
64- fi
65- ;;
66- *.js|*.ts|*.go|*.rs|*.kt|*.swift|*.php|*.rb|*.cs|*.dart|*.scala)
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")
70- fi
71- ;;
72- esac
73-
7452 # Check directory structure - must contain a valid category
7553 if [[ "$file" =~ \.(c|cpp|java|py|js|ts|go|rs|kt|swift|php|rb|cs|dart|scala)$ ]]; then
7654 if [[ ! "$dir" =~ (algorithms|data_structures|dynamic_programming|projects) ]]; then
You can’t perform that action at this time.
0 commit comments