add starlark format linting step

This commit is contained in:
Willy Kloucek
2021-05-06 11:48:09 +02:00
parent 4dac701997
commit 9a7ceee45f

View File

@@ -231,6 +231,7 @@ def main(ctx):
)
)
pipelines.append(checkStarlark)
pipelineSanityChecks(ctx, pipelines)
return pipelines
@@ -1578,6 +1579,43 @@ def deploy(ctx, config, rebuild):
},
}
def checkStarlark():
return [{
"kind": "pipeline",
"type": "docker",
"name": "check-starlark",
"steps": [
{
"name": "format-check-starlark",
"image": "owncloudci/bazel-buildifier",
"pull": "always",
"commands": [
"buildifier --mode=check .drone.star",
],
},
{
"name": "show-diff",
"image": "owncloudci/bazel-buildifier",
"pull": "always",
"commands": [
"buildifier --mode=fix .drone.star",
"git diff",
],
"when": {
"status": [
"failure",
],
},
},
],
"depends_on": [],
"trigger": {
"ref": [
"refs/pull/**",
],
},
}]
def genericCache(name, action, mounts, cache_key):
rebuild = 'false'
restore = 'false'