Skip to content
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion .github/workflows/zxc-code-style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,31 @@ jobs:
npm ci

- name: Check Code Style
run: task check
run: |
task check
mv eslint.log eslint-branch.log || true

- name: Compare warnings with main branch
run: |
git fetch origin main:main
git checkout main
task check
get_warnings() {
file="$1"
if [ -f "$file" ]; then
# Use awk to find the line containing "problems" and print the token before "warnings"
awk -F'[(), ]+' '/problems/ { for(i=1;i<=NF;i++) if($i=="warnings") print $(i-1) }' "$file" | tail -n1
else
echo 0
fi
}
branch_warnings=$(get_warnings eslint-branch.log)
main_warnings=$(get_warnings eslint.log)
echo "Warnings on branch: $branch_warnings"
echo "Warnings on main: $main_warnings"
if [ "$branch_warnings" -gt "$main_warnings" ]; then
echo "✘ Warnings have increased from $main_warnings to $branch_warnings"
exit 1
else
echo "✔ Warnings have not increased"
fi
Loading