Skip to content

Commit 2e678aa

Browse files
authored
[CI] Enable automatic NOLINT check (#373)
Forbid `NOLINT*` comments usage
1 parent 2914e47 commit 2e678aa

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

.github/workflows/static-analysis-pr.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,22 @@ jobs:
7878
run: |
7979
echo "clang-tidy run has failed. See previous 'Run clang-tidy' stage logs"
8080
exit 1
81+
nolint-check:
82+
runs-on: ubuntu-24.04
83+
steps:
84+
- uses: actions/checkout@v4
85+
- name: Search for NOLINT
86+
run: |
87+
export BASE_REF=${{ github.event.pull_request.base.ref }}
88+
export CHANGED_FILES="$(git diff --name-only origin/$BASE_REF HEAD | grep '^tasks/')"
89+
if [ -z "$CHANGED_FILES" ]; then
90+
echo "No changed files in tasks directory."
91+
exit 0
92+
fi
93+
for file in $CHANGED_FILES; do
94+
if grep -n "NOLINT" "$file"; then
95+
echo "::error::Found 'NOLINT' in $file."
96+
exit 1
97+
fi
98+
done
99+
echo "No 'NOLINT' markers found in changed files."

0 commit comments

Comments
 (0)