Skip to content

Commit 60468cb

Browse files
authored
Fix no-cheat check (#1092)
1 parent 4b5d31b commit 60468cb

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.github/workflows/no-cheat.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
NEW_CODE=$(git diff origin/main..$(git branch --show-current) | grep -e '^+')
4+
CHEAT=$(echo "${NEW_CODE}" | grep '# pylint: disable')
5+
if [ -n "${CHEAT}" ]; then
6+
echo "Do not cheat the linter: ${CHEAT}"
7+
exit 1
8+
fi

.github/workflows/push.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,4 @@ jobs:
7171
fetch-depth: 0
7272

7373
- name: Verify no lint disabled in the new code
74-
run: |
75-
NEW_CODE=$(git diff origin/main..$(git branch --show-current) | grep -e '^+')
76-
CHEAT=$(echo "${NEW_CODE}" | grep '# pylint: disable')
77-
if [ -n "${CHEAT}" ]; then
78-
echo "Do not cheat the linter: ${CHEAT}"
79-
exit 1
80-
fi
74+
run: sh .github/workflows/no-cheat.sh

0 commit comments

Comments
 (0)