Skip to content

Commit 826128a

Browse files
Merge pull request #2578 from jesseduffield/enforce-lowercase-filenames
2 parents aa70723 + aec4694 commit 826128a

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ jobs:
140140
run: |
141141
go generate pkg/integration/tests/tests.go && git diff --exit-code || (echo "Integration test list not up to date. Run 'go generate pkg/integration/tests/tests.go' locally and commit the changes" && exit 1)
142142
shell: bash # needed so that we get "-o pipefail"
143+
- name: Check Filenames
144+
run: scripts/check_filenames.sh
143145
lint:
144146
runs-on: ubuntu-latest
145147
env:
File renamed without changes.
File renamed without changes.

scripts/check_filenames.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
# Find all Go files in the project directory and its subdirectories, except in the vendor directory
4+
for file in $(find . -name "*.go" -not -path "./vendor/*"); do
5+
6+
# Check if the file name contains uppercase letters
7+
if [[ "$file" =~ [A-Z] ]]; then
8+
echo "Error: $file contains uppercase letters. All Go files in the project (excluding vendor directory) must use snake_case"
9+
exit 1
10+
fi
11+
done
12+
13+
echo "All Go files in the project (excluding vendor directory) use lowercase letters"
14+
exit 0

0 commit comments

Comments
 (0)