Skip to content

Commit 4b7c053

Browse files
Merge pull request #74 from rust-practice/simplify-add-new-type
Simplify-add-new-type
2 parents 2911c04 + 96afebd commit 4b7c053

File tree

3 files changed

+209
-129
lines changed

3 files changed

+209
-129
lines changed

Cargo.toml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
[package]
22
name = "cargo-leet"
3-
description = "Utility program to help with working on leetcode locally"
4-
repository = "https://github.com/rust-practice/cargo-leet"
53
version = "0.2.0"
64
authors = ["Members of Rust Practice Discord Server"]
7-
readme = "README.md"
8-
license = "MIT OR Apache-2.0"
95
edition = "2021"
6+
license = "MIT OR Apache-2.0"
7+
readme = "README.md"
8+
repository = "https://github.com/rust-practice/cargo-leet"
9+
description = "Utility program to help with working on leetcode locally"
1010

1111
[dependencies]
1212
anyhow = { version = "1.0.71", optional = true }
13+
clap = { version = "4.3.3", features = ["derive", "cargo"], optional = true }
1314
convert_case = { version = "0.6", optional = true }
1415
env_logger = { version = "0.11", optional = true }
1516
log = { version = "0.4.18", optional = true }
1617
regex = { version = "1.8.4", optional = true }
17-
serde_flat_path = { version = "0.1.2", optional = true }
18-
clap = { version = "4.3.3", features = ["derive", "cargo"], optional = true }
1918
serde = { version = "1.0.164", features = ["derive"], optional = true }
19+
serde_flat_path = { version = "0.1.2", optional = true }
20+
strum = { version = "0.26", features = ["derive"], optional = true }
2021
ureq = { version = "2.6", features = ["json"], optional = true }
21-
strum = { version = "0.26", features = ["derive"] }
2222

2323
[[bin]]
2424
name = "cargo-leet"
@@ -31,13 +31,14 @@ default = ["leet_env"]
3131
leet_env = []
3232
# Items used when running as a binary
3333
tool = [
34-
"anyhow",
35-
"convert_case",
36-
"env_logger",
37-
"log",
38-
"regex",
39-
"serde_flat_path",
40-
"clap",
41-
"serde",
42-
"ureq",
34+
"anyhow",
35+
"clap",
36+
"convert_case",
37+
"env_logger",
38+
"log",
39+
"regex",
40+
"serde_flat_path",
41+
"serde",
42+
"strum",
43+
"ureq",
4344
]

bacon.toml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# This is a configuration file for the bacon tool
2+
#
3+
# Bacon repository: https://github.com/Canop/bacon
4+
# Complete help on configuration: https://dystroy.org/bacon/config/
5+
# You can also check bacon's own bacon.toml file
6+
# as an example: https://github.com/Canop/bacon/blob/main/bacon.toml
7+
8+
default_job = "clippy"
9+
10+
[jobs.check]
11+
command = ["cargo", "check", "--all-features", "--color", "always"]
12+
need_stdout = false
13+
14+
[jobs.check-all]
15+
command = ["cargo", "check", "--all-targets", "--color", "always"]
16+
need_stdout = false
17+
18+
[jobs.clippy]
19+
command = ["cargo", "clippy", "--all-targets", "--all-features", "--color", "always"]
20+
need_stdout = false
21+
22+
# This job lets you run
23+
# - all tests: bacon test
24+
# - a specific test: bacon test -- config::test_default_files
25+
# - the tests of a package: bacon test -- -- -p config
26+
[jobs.test]
27+
command = [
28+
"cargo",
29+
"test",
30+
"--all-features",
31+
"--color",
32+
"always",
33+
"--",
34+
"--color",
35+
"always", # see https://github.com/Canop/bacon/issues/124
36+
]
37+
need_stdout = true
38+
39+
[jobs.doc]
40+
command = ["cargo", "doc", "--color", "always", "--no-deps"]
41+
need_stdout = false
42+
43+
# If the doc compiles, then it opens in your browser and bacon switches
44+
# to the previous job
45+
[jobs.doc-open]
46+
command = ["cargo", "doc", "--color", "always", "--no-deps", "--open"]
47+
need_stdout = false
48+
on_success = "back" # so that we don't open the browser at each change
49+
50+
# You can run your application and have the result displayed in bacon,
51+
# *if* it makes sense for this crate.
52+
# Don't forget the `--color always` part or the errors won't be
53+
# properly parsed.
54+
# If your program never stops (eg a server), you may set `background`
55+
# to false to have the cargo run output immediately displayed instead
56+
# of waiting for program's end.
57+
# [jobs.run]
58+
# command = [
59+
# "cargo",
60+
# "run",
61+
# "--color",
62+
# "always",
63+
# # put launch parameters for your program behind a `--` separator
64+
# ]
65+
# need_stdout = true
66+
# allow_warnings = true
67+
# background = true
68+
69+
# This parameterized job runs the example of your choice, as soon
70+
# as the code compiles.
71+
# Call it as
72+
# bacon ex -- my-example
73+
# [jobs.ex]
74+
# command = ["cargo", "run", "--color", "always", "--example"]
75+
# need_stdout = true
76+
# allow_warnings = true
77+
78+
# You may define here keybindings that would be specific to
79+
# a project, for example a shortcut to launch a specific job.
80+
# Shortcuts to internal functions (scrolling, toggling, etc.)
81+
# should go in your personal global prefs.toml file instead.
82+
[keybindings]
83+
# alt-m = "job:my-job"

0 commit comments

Comments
 (0)