Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
run: deno run -A ./scripts/build.ts --docker
- name: Test Wasm
run: deno run -A ./scripts/test_wasm.ts
- name: Generate config schema
run: 'deno run -A --minimum-dependency-age=0 jsr:@dprint/automation@0.14.3/tasks/publish-schema target/plugin.wasm deployment/schema.json --extension bzl'
- name: Lint workflow generation
run: |-
./.github/workflows/ci.ts --lint
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ const buildJob = job("build", {
{ name: "Build", run: "deno run -A ./scripts/build.ts --docker" },
// TinyGo can compile code differently than the Go compiler the tests use
{ name: "Test Wasm", run: "deno run -A ./scripts/test_wasm.ts" },
// checks the playground sample of the config schema, and that the plugin
// accepts every property in it
{
name: "Generate config schema",
run: [
"deno run -A --minimum-dependency-age=0 jsr:@dprint/automation@0.14.3/tasks/publish-schema",
"target/plugin.wasm deployment/schema.json --extension bzl",
].join(" "),
},
{
name: "Lint workflow generation",
run: [
Expand Down
30 changes: 30 additions & 0 deletions deployment/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://plugins.dprint.dev/dprint/dprint-plugin-buildifier/0.0.0/schema.json",
"type": "object",
"x-playground": {
"input": [
"load('@rules_cc//cc:defs.bzl', 'cc_library','cc_test')",
"",
"DEFAULT_COPTS=['-Wall','-Werror']",
"",
"def project_library(name, srcs, deps=[], testonly = False, **kwargs):",
" \"\"\"Defines a library and a test target for it.\"\"\"",
" cc_library(",
" name=name,",
" srcs=srcs,",
" copts=DEFAULT_COPTS+kwargs.pop('copts',[]),",
" deps=deps,",
" testonly=testonly,",
" visibility = ['//visibility:public'],",
" **kwargs",
" )",
" if len(srcs)>0 :",
" cc_test(name = name+'_test', srcs = [s.replace('.cc','_test.cc') for s in srcs], deps = [':' + name, '@googletest//:gtest_main'])",
"",
"",
"",
"def _version_impl(ctx):",
" out=ctx.actions.declare_file(ctx.label.name+'.txt')",
" ctx.actions.write(output=out,content=ctx.attr.version)",
" return [DefaultInfo(files=depset([out]))]",
"",
"version_file=rule(implementation=_version_impl,attrs={'version':attr.string(mandatory=True)})"
]
},
"properties": {
"newLineKind": {
"description": "The kind of newline to use. buildifier itself always uses line feeds.",
Expand Down
Loading