-
Notifications
You must be signed in to change notification settings - Fork 348
38 lines (33 loc) · 1.17 KB
/
debug_detector.yml
File metadata and controls
38 lines (33 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Debug Detector
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
developer-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Search for leftover debug content
run: |
set +e
found=0
echo "Checking for python print statements"
prints=$(grep -nRP --include='*.py' --exclude-dir=node_modules --exclude-dir=.venv --exclude-dir=.git --exclude-dir=.github --exclude-dir=build --exclude-dir=dist --exclude-dir=.svelte-kit -e '(?<!\.)\bprint\(' . || true)
if [ -n "$prints" ]; then
echo "$prints"
found=1
fi
echo "Checking for TODO or FIXME"
notes=$(grep -nR --exclude-dir=node_modules --exclude-dir=.venv --exclude-dir=.git --exclude-dir=.github --exclude-dir=build --exclude-dir=dist --exclude-dir=.svelte-kit -e 'TODO' -e 'FIXME' . || true)
if [ -n "$notes" ]; then
echo "$notes"
found=1
fi
if [ "$found" -ne 0 ]; then
echo "Developer content found" >&2
exit 1
else
echo "No developer content found"
fi