Skip to content

Commit a7a483e

Browse files
authored
Fail the build if pylint checks are disabled (#1089)
Related PR: - databrickslabs/lakebridge#191
1 parent dd506e8 commit a7a483e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/push.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,20 @@ jobs:
6161

6262
- name: Verify linting
6363
run: hatch run verify
64+
65+
no-lint-disabled:
66+
runs-on: ubuntu-latest
67+
steps:
68+
- name: Checkout
69+
uses: actions/checkout@v3
70+
with:
71+
fetch-depth: 0
72+
73+
- 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

0 commit comments

Comments
 (0)