File: check_filenames.sh

package info (click to toggle)
lazygit 0.53.0%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,016 kB
  • sloc: sh: 136; makefile: 76
file content (14 lines) | stat: -rwxr-xr-x 509 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

# Find all Go files in the project directory and its subdirectories, except in the vendor directory
for file in $(find . -name "*.go" -not -path "./vendor/*"); do

  # Check if the file name contains uppercase letters
  if [[ "$file" =~ [A-Z] ]]; then
    echo "Error: $file contains uppercase letters. All Go files in the project (excluding vendor directory) must use snake_case"
    exit 1
  fi
done

echo "All Go files in the project (excluding vendor directory) use lowercase letters"
exit 0