github: Check for todos (#3011)

This commit is contained in:
hedger 2023-08-25 17:38:41 +03:00 committed by GitHub
parent 940ec36a0b
commit c3aa151712
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,9 +23,8 @@ jobs:
- name: 'Checkout code'
uses: actions/checkout@v3
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2
ref: ${{ github.sha }}
- name: 'Check protobuf branch'
run: |
@ -48,8 +47,26 @@ jobs:
exit 1;
fi
- name: 'Check for new TODOs'
id: check_todos
if: github.event_name == 'pull_request'
run: |
set +e;
git diff --unified=0 --no-color ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -E '^\+' | grep -i -E '(TODO|HACK|FIXME|XXX)[ :]' | grep -v -- '-nofl' > lines.log;
MISSING_TICKETS=$( grep -v -E '\[FL-[0-9]+\]' lines.log );
if [ -n "$MISSING_TICKETS" ]; then
echo "Error: Missing ticket number in \`TODO\` comment(s)" >> $GITHUB_STEP_SUMMARY;
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY;
echo "$MISSING_TICKETS" >> $GITHUB_STEP_SUMMARY;
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY;
exit 1;
else
echo "No new TODOs without tickets found" >> $GITHUB_STEP_SUMMARY;
fi
- name: 'Check Python code formatting'
id: syntax_check_py
if: always()
run: |
set +e;
./fbt -s lint_py 2>&1 | tee lint-py.log;