Skip to content

Commit 8614e25

Browse files
committed
chore: use baco instead of cargo watch
1 parent cd47c6e commit 8614e25

File tree

2 files changed

+113
-2
lines changed

2 files changed

+113
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ bench:
2121
cargo bench
2222

2323
dev:
24-
RUST_LOG=INFO cargo watch -w src -x 'run -- -c=~/tmp/pingap?separation --admin=pingap:[email protected]:3018 --autoreload'
24+
RUST_LOG=INFO bacon run -- -- -c=~/tmp/pingap?separation --admin=pingap:[email protected]:3018 --autoreload
2525

2626
devetcd:
27-
RUST_LOG=INFO cargo watch -w src -x 'run -- -c="etcd://127.0.0.1:2379/pingap?timeout=10s&connect_timeout=5s" --admin=127.0.0.1:3018 --autoreload'
27+
RUST_LOG=INFO bacon run -- -- -c="etcd://127.0.0.1:2379/pingap?timeout=10s&connect_timeout=5s" --admin=127.0.0.1:3018 --autoreload
2828

2929
mermaid:
3030
cargo run --bin generate-mermaid

bacon.toml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# This is a configuration file for the bacon tool
2+
#
3+
# Complete help on configuration: https://dystroy.org/bacon/config/
4+
#
5+
# You may check the current default at
6+
# https://github.com/Canop/bacon/blob/main/defaults/default-bacon.toml
7+
8+
default_job = "check"
9+
env.CARGO_TERM_COLOR = "always"
10+
11+
[jobs.check]
12+
command = ["cargo", "check"]
13+
need_stdout = false
14+
15+
[jobs.check-all]
16+
command = ["cargo", "check", "--all-targets"]
17+
need_stdout = false
18+
19+
# Run clippy on the default target
20+
[jobs.clippy]
21+
command = ["cargo", "clippy"]
22+
need_stdout = false
23+
24+
# Run clippy on all targets
25+
# To disable some lints, you may change the job this way:
26+
# [jobs.clippy-all]
27+
# command = [
28+
# "cargo", "clippy",
29+
# "--all-targets",
30+
# "--",
31+
# "-A", "clippy::bool_to_int_with_if",
32+
# "-A", "clippy::collapsible_if",
33+
# "-A", "clippy::derive_partial_eq_without_eq",
34+
# ]
35+
# need_stdout = false
36+
[jobs.clippy-all]
37+
command = ["cargo", "clippy", "--all-targets"]
38+
need_stdout = false
39+
40+
# This job lets you run
41+
# - all tests: bacon test
42+
# - a specific test: bacon test -- config::test_default_files
43+
# - the tests of a package: bacon test -- -- -p config
44+
[jobs.test]
45+
command = ["cargo", "test"]
46+
need_stdout = true
47+
48+
[jobs.nextest]
49+
command = [
50+
"cargo", "nextest", "run",
51+
"--hide-progress-bar", "--failure-output", "final"
52+
]
53+
need_stdout = true
54+
analyzer = "nextest"
55+
56+
[jobs.doc]
57+
command = ["cargo", "doc", "--no-deps"]
58+
need_stdout = false
59+
60+
# If the doc compiles, then it opens in your browser and bacon switches
61+
# to the previous job
62+
[jobs.doc-open]
63+
command = ["cargo", "doc", "--no-deps", "--open"]
64+
need_stdout = false
65+
on_success = "back" # so that we don't open the browser at each change
66+
67+
# You can run your application and have the result displayed in bacon,
68+
# if it makes sense for this crate.
69+
[jobs.run]
70+
command = [
71+
"cargo", "run",
72+
# put launch parameters for your program behind a `--` separator
73+
]
74+
need_stdout = true
75+
allow_warnings = true
76+
background = true
77+
78+
# Run your long-running application (eg server) and have the result displayed in bacon.
79+
# For programs that never stop (eg a server), `background` is set to false
80+
# to have the cargo run output immediately displayed instead of waiting for
81+
# program's end.
82+
# 'on_change_strategy' is set to `kill_then_restart` to have your program restart
83+
# on every change (an alternative would be to use the 'F5' key manually in bacon).
84+
# If you often use this job, it makes sense to override the 'r' key by adding
85+
# a binding `r = job:run-long` at the end of this file .
86+
[jobs.run-long]
87+
command = [
88+
"cargo", "run",
89+
# put launch parameters for your program behind a `--` separator
90+
]
91+
need_stdout = true
92+
allow_warnings = true
93+
background = false
94+
on_change_strategy = "kill_then_restart"
95+
96+
# This parameterized job runs the example of your choice, as soon
97+
# as the code compiles.
98+
# Call it as
99+
# bacon ex -- my-example
100+
[jobs.ex]
101+
command = ["cargo", "run", "--example"]
102+
need_stdout = true
103+
allow_warnings = true
104+
105+
# You may define here keybindings that would be specific to
106+
# a project, for example a shortcut to launch a specific job.
107+
# Shortcuts to internal functions (scrolling, toggling, etc.)
108+
# should go in your personal global prefs.toml file instead.
109+
[keybindings]
110+
# alt-m = "job:my-job"
111+
c = "job:clippy-all" # comment this to have 'c' run clippy on only the default target

0 commit comments

Comments
 (0)