Skip to content

Commit

Permalink
Merge pull request #23 from appthrust/test
Browse files Browse the repository at this point in the history
Add plugin for buildifier
  • Loading branch information
suin authored Jun 21, 2024
2 parents 35723d3 + 0f34a90 commit 12b37e5
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 6 deletions.
7 changes: 1 addition & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
{
"name": "Ubuntu",
"name": "appthrust/proto-toml-plugin",
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"runArgs": ["--platform=linux/amd64"],
"workspaceFolder": "/workspace",
"remoteEnv": {
"PATH": "/root/.proto/shims:/root/.proto/bin:${containerEnv:PATH}"
},
"customizations": {
"jetbrains": {
"backend": "IntelliJ"
}
},
"postCreateCommand": ".devcontainer/setup.sh"
}
21 changes: 21 additions & 0 deletions buildifier/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# buildifier plugin

[buildifier](https://github.com/bazelbuild/buildtools/tree/master/buildifier#linter) plugin for [proto](https://github.com/moonrepo/proto).

## Installation

This is a community plugin and is thus not built-in to proto. In order to use it, first either add it to your global or project-based `.prototools` by running:

### Global install

```shell
proto plugin add buildifier "source:https://raw.githubusercontent.com/appthrust/proto-toml-plugins/main/buildifier/plugin.toml" --global
proto install buildifier
```

### Per-project install

```shell
proto plugin add buildifier "source:https://raw.githubusercontent.com/appthrust/proto-toml-plugins/main/buildifier/plugin.toml"
proto pin buildifier latest --resolve
```
8 changes: 8 additions & 0 deletions buildifier/plugin.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { run } from "../testkit.js";

run({
name: "sccache",
afterInstall: async ($) => {
await $`sccache --version`;
},
});
30 changes: 30 additions & 0 deletions buildifier/plugin.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# A TOML plugin for buildifier
# https://moonrepo.dev/docs/proto/plugins#toml-plugin

name = "buildifier"
type = "cli"

[platform.linux]
bin-path = "buildifier"
download-file = "buildifier-linux-{arch}"
checksum-file = "checksums.txt"

[platform.macos]
bin-path = "buildifier"
download-file = "buildifier-darwin-{arch}"
checksum-file = "checksums.txt"

[platform.windows]
bin-path = "buildifier.exe"
download-file = "buildifier-windows-{arch}.exe"
checksum-file = "checksums.txt"

[install]
download-url = "https://github.com/bazelbuild/buildtools/releases/download/v{version}/{download_file}"

[install.arch]
aarch64 = "arm64"
x86_64 = "amd64"

[resolve]
git-url = "https://github.com/bazelbuild/buildtools"

0 comments on commit 12b37e5

Please sign in to comment.