Skip to content

Commit

Permalink
Add rustfmt to pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
louwers committed Jan 10, 2025
1 parent 29a2bb2 commit bfafa2b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ repos:
hooks:
- id: swiftformat
args: [--swiftversion, "5.8"]
- repo: https://github.com/doublify/pre-commit-rust
rev: master
hooks:
- id: fmt
- id: cargo-check
ci:
# sometimes fails https://github.com/keith/pre-commit-buildifier/issues/13
skip: [buildifier]
Expand Down
6 changes: 3 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_library", "js_run_binary")
load("@bazel_skylib//rules:common_settings.bzl", "string_flag", "bool_flag")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag")
load("@npm//:defs.bzl", "npm_link_all_packages")
load(
"//bazel:core.bzl",
Expand Down Expand Up @@ -154,8 +154,8 @@ cc_library(
],
"//conditions:default": [
"//vendor:csscolorparser",
]
})
],
}),
)

genrule(
Expand Down
4 changes: 1 addition & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,15 @@ darwin_config(
bazel_dep(name = "rules_rust", version = "0.56.0")

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")

rust.toolchain(
edition = "2021",
versions = ["1.80.0"]
versions = ["1.80.0"],
)
use_repo(rust, "rust_toolchains")

register_toolchains("@rust_toolchains//:all")

crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")

crate.from_cargo(
name = "crates",
cargo_lockfile = "//rustutils:Cargo.lock",
Expand Down
2 changes: 1 addition & 1 deletion bazel/core.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ MLN_CORE_SOURCE = [
],
"//conditions:default": [
"src/mbgl/util/color.cpp",
]
],
})

MLN_CORE_HEADERS = [
Expand Down
8 changes: 4 additions & 4 deletions rustutils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ rust_static_library(
cc_library(
name = "rustutilslib",
srcs = [
"cpp/src/lib.rs.cc"
"cpp/src/lib.rs.cc",
],
hdrs = [
"cpp/include/rustutils/lib.hpp"
"cpp/include/rustutils/lib.hpp",
],
includes = [
"cpp/include"
"cpp/include",
],
visibility = ["//visibility:public"],
deps = [
":rustutils",
],
visibility = ["//visibility:public"],
)

0 comments on commit bfafa2b

Please sign in to comment.