Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/trailing-spaces.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Trailing Spaces Check

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
check-trailing-spaces:

Check warning on line 10 in .github/workflows/trailing-spaces.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

excessive-permissions

trailing-spaces.yml:10: overly broad permissions: default permissions used due to no permissions: block
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

Check failure on line 13 in .github/workflows/trailing-spaces.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

zizmor/unpinned-uses

unpinned action reference: action is not pinned to a hash (required by blanket policy)

Check failure on line 13 in .github/workflows/trailing-spaces.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

unpinned-uses

trailing-spaces.yml:13: unpinned action reference: action is not pinned to a hash (required by blanket policy)
- name: Check for trailing spaces
run: |
# Find all files with trailing spaces (excluding .git, caches, and binary files)
trailing_files=$(grep -rnl '[[:blank:]]$' . \
--exclude-dir=.git \
--exclude-dir=__pycache__ \
--exclude-dir=.venv \
--exclude-dir=venv \
--exclude-dir=env \
--exclude-dir=node_modules \
--exclude=\*.png \
--exclude=\*.jpg \
--exclude=\*.jpeg \
--exclude=\*.gif \
--exclude=\*.ico \
--exclude=\*.pyc || true)

if [ -n "$trailing_files" ]; then
echo "::error::Trailing spaces found in the following files:"
echo "$trailing_files"
exit 1
else
echo "No trailing spaces found. Great job!"
fi
Loading