Skip to content

Commit

Permalink
feat: 🎸 add black plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
suin committed Apr 9, 2024
1 parent 68c5f53 commit b6b6cdd
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ jobs:

steps:
- uses: actions/checkout@v4

- if: github.ref_name != 'main'
run: |
set -eux
sed -i '' "s/appthrust\/proto-toml-plugins\/main/appthrust\/proto-toml-plugins\/${{ github.ref_name }}/g" .prototools
cat .prototools
- name: Install
uses: moonrepo/setup-toolchain@v0
env:
PROTO_LOG: debug
with:
auto-install: true
cache: false
cache: false
4 changes: 4 additions & 0 deletions .prototools
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
black = "24.3.0"
k3d = "5.6.0"
moon = "1.23.4"

[plugins]
black = "source:https://raw.githubusercontent.com/appthrust/proto-toml-plugins/main/black/plugin.toml"
k3d = "source:https://raw.githubusercontent.com/appthrust/proto-toml-plugins/main/k3d/plugin.toml"
moon = "source:https://raw.githubusercontent.com/moonrepo/moon/master/proto-plugin.toml"
22 changes: 22 additions & 0 deletions black/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# black plugin

[black](https://black.readthedocs.io/en/stable/) 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 black "source:https://raw.githubusercontent.com/appthrust/proto-toml-plugins/main/black/plugin.toml" --global
proto install black
```

### Per-project install

```shell
proto plugin add black "source:https://raw.githubusercontent.com/appthrust/proto-toml-plugins/main/black/plugin.toml"
proto pin black latest --resolve
```

27 changes: 27 additions & 0 deletions black/plugin.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# A TOML plugin for proto:
# https://moonrepo.dev/docs/proto/plugins#toml-plugin

name = "black"
type = "cli"

[platform.linux]
download-file = "black_linux"
checksum-file = "checksums.txt"

[platform.macos]
download-file = "black_macos"
checksum-file = "checksums.txt"

[platform.windows]
download-file = "black_windows.exe"
checksum-file = "checksums.txt"

[install]
download-url = "https://github.com/psf/black/releases/download/{version}/{download_file}"

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

[resolve]
git-url = "https://github.com/psf/black"

0 comments on commit b6b6cdd

Please sign in to comment.