Skip to content

Commit

Permalink
lint starlark
Browse files Browse the repository at this point in the history
  • Loading branch information
wkloucek committed May 6, 2021
1 parent 8c82793 commit a85d17d
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit a85d17d

Please sign in to comment.