obsproject / obs-plugintemplate

GNU General Public License v2.0
307 stars 141 forks source link

ci: output diff on code format failures #67

Closed glikely closed 1 year ago

glikely commented 1 year ago

Description

It is useful to know why the format checks failed. When it happens, use git diff to display the change that is required.

Motivation and Context

This patch modifies check-cmake.sh to behave the same as check-format.sh. It now unconditionally reformats the file to meet convention which check-changes.sh can detect. Then check-changes.sh can display all the formatting changes in the build log, making it easier to fix the issues quickly.

How Has This Been Tested?

Tested locally and via GitHub actions CI

Example of output when formatting changes are needed can be seen here: https://github.com/glikely/obs-plugintemplate/actions/runs/4366259875/jobs/7636020253#step:7:1

Types of changes

Checklist: