Skip to content

Commit

Permalink
add starlark format linting step
Browse files Browse the repository at this point in the history
  • Loading branch information
wkloucek committed May 6, 2021
1 parent 4dac701 commit 9a7ceee
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ def main(ctx):
)
)

pipelines.append(checkStarlark)
pipelineSanityChecks(ctx, pipelines)
return pipelines

Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit 9a7ceee

Please sign in to comment.