From a85d17d27f0cf6d22eeeaf8d205d62398019e709 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 6 May 2021 10:47:31 +0200 Subject: [PATCH] lint starlark --- .drone.star | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/.drone.star b/.drone.star index d74f0caf9c8..4292c30adf4 100644 --- a/.drone.star +++ b/.drone.star @@ -550,7 +550,7 @@ def main(ctx): after = afterPipelines(ctx) dependsOn(stages, after) - return before + stages + after + return before + stages + after + checkStarlark() def beforePipelines(ctx): return yarnlint() + changelog(ctx) + website(ctx) @@ -2278,6 +2278,43 @@ def githubComment(): }, }] +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 dependsOn(earlierStages, nextStages): for earlierStage in earlierStages: for nextStage in nextStages: