clang-format lint check

This commit is contained in:
Sean Darcy 2023-03-24 04:56:27 +00:00 committed by Jason Rhinelander
parent 97aa52ed4e
commit 45db02de78
No known key found for this signature in database
GPG Key ID: C4992CE7A88D4262
2 changed files with 25 additions and 0 deletions

View File

@ -237,6 +237,24 @@ local gui_wallet_step_darwin = {
[
{
name: 'lint check',
kind: 'pipeline',
type: 'docker',
steps: [{
name: 'build',
image: docker_base + 'lint',
pull: 'always',
commands: [
'echo "Building on ${DRONE_STAGE_MACHINE}"',
apt_get_quiet + ' update',
apt_get_quiet + ' install -y eatmydata',
'eatmydata ' + apt_get_quiet + ' install --no-install-recommends -y git clang-format-14 jsonnet',
'./contrib/drone-format-verify.sh',
],
}],
},
// Static build to make wallet3:
{
name: 'Static (wallet3)',

7
contrib/drone-format-verify.sh Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
test "x$IGNORE" != "x" && exit 0
set -e
repo=$(readlink -e $(dirname $0)/../)
clang-format-14 -i $(find $repo/{src,pybind} | grep -E '\.[hc](pp)?$')
jsonnetfmt -i $repo/.drone.jsonnet
git --no-pager diff --exit-code --color || (echo -ne '\n\n\e[31;1mLint check failed; please run ./contrib/format.sh\e[0m\n\n' ; exit 1)