mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-01-02 10:17:10 +03:00
github: Check for todos (#3011)
This commit is contained in:
parent
940ec36a0b
commit
c3aa151712
23
.github/workflows/lint_and_submodule_check.yml
vendored
23
.github/workflows/lint_and_submodule_check.yml
vendored
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user