Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 5 additions & 8 deletions .github/workflows/ci-check-fmt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,19 @@ jobs:
build_buddy_token: ${{ secrets.build_buddy_token }}

- name: Format bazel
run: ./tools/scripts/buildifier $(git ls-files "*.bzl" "*.bazel" | xargs ls 2>/dev/null)
run: bazel run //tools/buildifier -- $(git ls-files "*.bzl" "*.bazel" | xargs ls 2>/dev/null)

- name: Format dprint
run: ./tools/scripts/dprint fmt
run: bazel run //tools/dprint -- fmt

- name: Format buf
run: ./tools/scripts/buf format -w --disable-symlinks --debug
run: bazel run //tools/buf -- format -w --disable-symlinks --debug

- name: Format just
run: ./tools/scripts/just --unstable --fmt
run: bazel run //tools/just -- --unstable --fmt

- name: Format shfmt
run: ./tools/scripts/shfmt -w .

- name: Format cedar
run: git ls-files "*.cedar" | xargs ls 2>/dev/null | xargs -I {} ./tools/scripts/cedar format -w -p {}
run: bazel run //tools/shfmt -- -w .

- name: Exit on diff
run: git diff --exit-code
3 changes: 0 additions & 3 deletions .github/workflows/ci-check-vendor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,5 @@ jobs:
- name: Vendor Cargo
run: bazel run //vendor:cargo_vendor

- name: Vendor Bindeps
run: bazel run //vendor:bindeps

- name: Exit on change
run: git diff --exit-code
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Adding the following to your `/etc/docker/daemon.json`:

#### Scripts / Tools

We provide a bunch of tools which we vendor by wrapping them into a Bazel rule, you can find them in [`tools/scripts`](./tools/scripts/README.md). We recommend adding this directory to the front of your `PATH` (automatically done if you use [direnv](#environment-variables)).
We provide a bunch of tools which we vendor by using [rules_multitool](https://github.com/bazel-contrib/rules_multitool). We recommend adding this directory to the front of your `PATH` (automatically done if you use [direnv](#environment-variables)).

### VSCode Setup

Expand Down
12 changes: 5 additions & 7 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ default:

fmt:
bazel run //tools/cargo/fmt:fix
buildifier $(git ls-files "*.bzl" "*.bazel" | xargs ls 2>/dev/null)
dprint fmt
buf format -w --disable-symlinks --debug
just --unstable --fmt
shfmt -w .
git ls-files "*.cedar" | xargs ls 2>/dev/null | xargs -I {} cedar format -w -p {}
bazel run //tools/buildifier -- $(git ls-files "*.bzl" "*.bazel" | xargs ls 2>/dev/null)
bazel run //tools/dprint -- fmt
bazel run //tools/buf -- format -w --disable-symlinks --debug
bazel run //tools/just -- --unstable --fmt
bazel run //tools/shfmt -- -w .

lint:
bazel run //tools/cargo/clippy:fix
Expand Down Expand Up @@ -136,7 +135,6 @@ alias vendor := lockfile
lockfile:
cargo update --workspace
bazel run //vendor:cargo_vendor
bazel run //vendor:bindeps
pnpm install --lockfile-only

grind *targets="//...":
Expand Down
7 changes: 7 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ bazel_dep(name = "rules_go", version = "0.57.0")
bazel_dep(name = "openssl", version = "3.3.1.bcr.7")
bazel_dep(name = "rules_java", version = "8.15.2")
bazel_dep(name = "bazel_features", version = "1.32.0")
bazel_dep(name = "rules_multitool", version = "1.9.0")

include("//misc/toolchains:docker.MODULE.bazel")

Expand All @@ -36,3 +37,9 @@ include("//misc/toolchains:bazel-diff.MODULE.bazel")
include("//misc/toolchains:valgrind.MODULE.bazel")

include("//misc/toolchains:assets.MODULE.bazel")

include("//misc/toolchains:diesel.MODULE.bazel")

multitool = use_extension("@rules_multitool//multitool:extension.bzl", "multitool")
multitool.hub(lockfile = "//:multitool.lock.json")
use_repo(multitool, "multitool")
16 changes: 7 additions & 9 deletions dprint.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,21 @@
"indentWidth": 4,
"trailingCommas": "never"
},
"markdown": {
},
"markdown": {},
"toml": {
"indentWidth": 4
},
"dockerfile": {
},
"malva": {
},
"dockerfile": {},
"malva": {},
"markup": {
"indentWidth": 4,
"svelteAttrShorthand": true,
"svelteDirectiveShorthand": true,
"scriptIndent": true,
"styleIndent": true
},
"yaml": {
},
"cedar": {},
"yaml": {},
"excludes": [
"**/node_modules",
"**/*-lock.json",
Expand All @@ -40,6 +37,7 @@
"https://plugins.dprint.dev/g-plane/malva-v0.14.2.wasm",
"https://plugins.dprint.dev/g-plane/markup_fmt-v0.23.2.wasm",
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
"https://plugins.dprint.dev/ruff-0.4.8.wasm"
"https://plugins.dprint.dev/ruff-0.4.8.wasm",
"https://github.com/ScuffleCloud/dprint-plugin-cedar/releases/download/commit-79d0bfa58bb082c19b8955c19159c3f81e677857/dprint_plugin_cedar.wasm"
]
}
58 changes: 58 additions & 0 deletions misc/toolchains/diesel.MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

build_url = "https://github.com/diesel-rs/diesel/releases/download/v2.3.2/"

http_archive(
name = "diesel-macos-aarch64",
build_file_content = """exports_files(["diesel"])""",
sha256 = "eb6ac9b6c1804a9b83d8d4521ee7f54cc02b59be06012d532ba029f9f870f621",
strip_prefix = "diesel_cli-aarch64-apple-darwin",
url = "{url}{file}".format(
file = "diesel_cli-aarch64-apple-darwin.tar.xz",
url = build_url,
),
)

http_archive(
name = "diesel-linux-aarch64",
build_file_content = """exports_files(["diesel"])""",
sha256 = "a1f6005b7fae79d27d2eb1c642d800c8a2ae883b3849b39b054dee234a872e78",
strip_prefix = "diesel_cli-aarch64-unknown-linux-gnu",
url = "{url}{file}".format(
file = "diesel_cli-aarch64-unknown-linux-gnu.tar.xz",
url = build_url,
),
)

http_archive(
name = "diesel-macos-x86_64",
build_file_content = """exports_files(["diesel"])""",
sha256 = "e32589d16bea3195ab7da37a32200996c3d98bff7f5644d16c8acc91ef54d2b9",
strip_prefix = "diesel_cli-x86_64-apple-darwin",
url = "{url}{file}".format(
file = "diesel_cli-x86_64-apple-darwin.tar.xz",
url = build_url,
),
)

http_archive(
name = "diesel-windows-x86_64",
build_file_content = """exports_files(["diesel.exe"])""",
sha256 = "a3ee515a8f4be8c77b864b8802d2bda7a0cc3e6a802b07942fad1a5c01d92f47",
strip_prefix = "diesel_cli-x86_64-pc-windows-msvc",
url = "{url}{file}".format(
file = "diesel_cli-x86_64-pc-windows-msvc.zip",
url = build_url,
),
)

http_archive(
name = "diesel-linux-x86_64",
build_file_content = """exports_files(["diesel"])""",
sha256 = "63267a24efc591a61ed5be77c938377aed0e0829f3075be13504f42297d29c50",
strip_prefix = "diesel_cli-x86_64-unknown-linux-gnu",
url = "{url}{file}".format(
file = "diesel_cli-x86_64-unknown-linux-gnu.tar.xz",
url = build_url,
),
)
2 changes: 1 addition & 1 deletion misc/toolchains/js.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use_repo(npm, "npm")

pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
pnpm.pnpm(
pnpm_version = "10.15.0",
pnpm_version = "10.18.1",
pnpm_version_integrity = "sha512-SG68JZ0+mZpOhpHOA7XKxKccvso5Nyqbdiy1AM/fCHPiyxar49lRse4s8BJQPwJ7mLZYTk3yJSTgx0UNnseqew==",
)
use_repo(pnpm, "pnpm")
Expand Down
14 changes: 0 additions & 14 deletions misc/toolchains/rust.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -339,17 +339,3 @@ use_repo(
"cargo_vendor__walkdir-2.5.0",
"cargo_vendor__webauthn-rs-0.5.2",
)

bindeps = use_extension("//vendor:cargo_ext.bzl", "bindeps")
use_repo(
bindeps,
"bindeps",
"bindeps__cargo-deny-0.18.4",
"bindeps__cargo-insta-1.43.2",
"bindeps__cedar-policy-cli-4.5.1",
"bindeps__diesel_cli-2.3.2",
"bindeps__dprint-0.50.2",
"bindeps__just-1.42.4",
"bindeps__miniserve-0.31.0",
"bindeps__rust-analyzer-0.0.0",
)
Loading