summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-04-29 12:58:28 +1000
committerJesse Duffield <jessedduffield@gmail.com>2023-04-29 13:05:05 +1000
commitaec46942a85f060bf8dc85a4197e5b7baae38804 (patch)
tree5818254f8bc9a77ff5e22ade7b8e7d70cc2a2a4e /scripts
parentaa70723e3a7211c01ccfb78c710dbf7808037c6c (diff)
enforce lowercase filenames
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check_filenames.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/check_filenames.sh b/scripts/check_filenames.sh
new file mode 100755
index 000000000..a9b3c242d
--- /dev/null
+++ b/scripts/check_filenames.sh
@@ -0,0 +1,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