Add ci lint job
This commit is contained in:
parent
511ae36ac1
commit
306010094e
|
@ -130,6 +130,24 @@ local static_check_and_upload = [
|
|||
|
||||
|
||||
[
|
||||
{
|
||||
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-11 jsonnet',
|
||||
'./contrib/drone-format-verify.sh',
|
||||
],
|
||||
}],
|
||||
},
|
||||
|
||||
// Various debian builds
|
||||
debian_pipeline('Debian (amd64)', docker_base + 'debian-sid', lto=true),
|
||||
debian_pipeline('Debian Debug (amd64)', docker_base + 'debian-sid', build_type='Debug'),
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
test "x$IGNORE" != "x" && exit 0
|
||||
repo=$(readlink -e $(dirname $0)/../)
|
||||
clang-format-11 -i $(find $repo/{httpserver,crypto,storage,utils,unit_test,common} | grep -E '\.[hc](pp)?$' | grep -v 'Catch2')
|
||||
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)
|
Loading…
Reference in New Issue