Skip to content
Open
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
3 changes: 3 additions & 0 deletions .restyled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
restylers:
- pyment:
enabled: false
- rustfmt:
image: "toxchat/restylers:rustfmt"
arguments: ["--edition=2024"]
- "*"
28 changes: 0 additions & 28 deletions admin/repos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1019,34 +1019,6 @@ hs-toxcore:
# - "build / stack"
# - "checks / check-release"

js-toxcore-c:
editRepo:
<<: *editRepo
name: "js-toxcore-c"
description: "Node bindings for toxcore"
homepage: "https://toktok.ltd"
topics: "toxcore, js, ffi"

labels: *labels
rulesets: *rulesets
branches:
"master":
<<: *branchProtection
required_status_checks:
strict: true
contexts:
# Common
- "Mergeable"
- "Milestone Check"
- "code-review/reviewable"
- "common / buildifier"
- "common / restyled"
- "release / update_release_draft"
# Custom
- "DeepScan"
- "Hound"
- "security/snyk (TokTok)"

jvm-toxcore-c:
editRepo:
<<: *editRepo
Expand Down
2 changes: 2 additions & 0 deletions tools/gitui/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
target-dir = "/tmp/gitui_target"
141 changes: 141 additions & 0 deletions tools/gitui/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_clippy", "rust_library", "rust_test")

rust_library(
name = "gitui_lib",
srcs = [
"src/diff_utils.rs",
"src/engine/executor.rs",
"src/engine/git.rs",
"src/engine/github.rs",
"src/engine/mod.rs",
"src/engine/planner.rs",
"src/engine/topology.rs",
"src/engine/transaction.rs",
"src/engine/types.rs",
"src/lib.rs",
"src/patch_utils.rs",
"src/runtime.rs",
"src/split_state.rs",
"src/state/actions.rs",
"src/state/input.rs",
"src/state/mod.rs",
"src/state/reducer.rs",
"src/state/types.rs",
"src/testing.rs",
"src/topology/mod.rs",
"src/topology/virtual_layer.rs",
"src/ui/common.rs",
"src/ui/main_view.rs",
"src/ui/mod.rs",
"src/ui/preview_view.rs",
"src/ui/prompt_view.rs",
"src/ui/split_view.rs",
],
crate_name = "gitui",
edition = "2024",
tags = ["no-cross"],
visibility = ["//visibility:public"],
deps = [
"@crates//:anyhow",
"@crates//:crossterm",
"@crates//:git2",
"@crates//:indexmap",
"@crates//:itertools",
"@crates//:petgraph",
"@crates//:ratatui",
"@crates//:serde",
"@crates//:serde_json",
"@crates//:tempfile",
"@crates//:tokio",
"@crates//:unicode-segmentation",
],
)

rust_binary(
name = "gitui",
srcs = ["src/main.rs"],
edition = "2024",
rustc_flags = ["-Clink-arg=-fuse-ld=bfd"],
tags = ["no-cross"],
deps = [
":gitui_lib",
"@crates//:anyhow",
"@crates//:clap",
"@crates//:serde",
"@crates//:serde_json",
"@crates//:tokio",
],
)

TEST_SRCS = glob(
["test/*.rs"],
exclude = ["test/apply_cli_tests.rs"],
)

[
rust_test(
name = test_file.replace("test/", "").replace(".rs", ""),
size = "small",
srcs = [test_file],
data = glob(["test/snapshots/**"]) + ["@git"],
edition = "2024",
env = {"GITUI_GIT_BIN": "$(rootpath @git)"},
env_inherit = ["PATH"],
rustc_flags = ["-Clink-arg=-fuse-ld=bfd"],
tags = ["no-cross"],
deps = [
":gitui_lib",
"@crates//:anyhow",
"@crates//:crossterm",
"@crates//:git2",
"@crates//:insta",
"@crates//:petgraph",
"@crates//:proptest",
"@crates//:ratatui",
"@crates//:regex",
"@crates//:tempfile",
"@crates//:tokio",
],
)
for test_file in TEST_SRCS
]

# Special-cased: shells out to the built gitui binary, so it needs the binary
# as a data dep and the path injected via env.
rust_test(
name = "apply_cli_tests",
size = "small",
srcs = ["test/apply_cli_tests.rs"],
data = [
":gitui",
"@git",
],
edition = "2024",
env = {
"GITUI_BIN": "$(rootpath :gitui)",
"GITUI_GIT_BIN": "$(rootpath @git)",
},
env_inherit = ["PATH"],
rustc_flags = ["-Clink-arg=-fuse-ld=bfd"],
tags = ["no-cross"],
deps = [
":gitui_lib",
"@crates//:git2",
"@crates//:serde_json",
"@crates//:tempfile",
],
)

rust_clippy(
name = "clippy",
testonly = True,
tags = ["no-cross"],
deps = [
":apply_cli_tests",
":gitui",
":gitui_lib",
] + [
":" + src.replace("test/", "").replace(".rs", "")
for src in TEST_SRCS
],
)
Loading
Loading