chore: set up taplo; format TOML files
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I476156f5f0fa069135862cfac6cafdc46a6a6964
This commit is contained in:
parent
ea96477830
commit
ce55a66e9c
4 changed files with 96 additions and 91 deletions
|
|
@ -1,26 +1,26 @@
|
||||||
condense_wildcard_suffixes = true
|
condense_wildcard_suffixes = true
|
||||||
doc_comment_code_block_width = 80
|
doc_comment_code_block_width = 80
|
||||||
edition = "2024" # Keep in sync with Cargo.toml.
|
edition = "2024" # Keep in sync with Cargo.toml.
|
||||||
enum_discrim_align_threshold = 60
|
enum_discrim_align_threshold = 60
|
||||||
force_explicit_abi = false
|
force_explicit_abi = false
|
||||||
force_multiline_blocks = true
|
force_multiline_blocks = true
|
||||||
format_code_in_doc_comments = true
|
format_code_in_doc_comments = true
|
||||||
format_macro_matchers = true
|
format_macro_matchers = true
|
||||||
format_strings = true
|
format_strings = true
|
||||||
group_imports = "StdExternalCrate"
|
group_imports = "StdExternalCrate"
|
||||||
hex_literal_case = "Upper"
|
hex_literal_case = "Upper"
|
||||||
imports_granularity = "Crate"
|
imports_granularity = "Crate"
|
||||||
imports_layout = "HorizontalVertical"
|
imports_layout = "HorizontalVertical"
|
||||||
inline_attribute_width = 60
|
inline_attribute_width = 60
|
||||||
match_block_trailing_comma = true
|
match_block_trailing_comma = true
|
||||||
max_width = 80
|
max_width = 80
|
||||||
newline_style = "Unix"
|
newline_style = "Unix"
|
||||||
normalize_comments = true
|
normalize_comments = true
|
||||||
normalize_doc_attributes = true
|
normalize_doc_attributes = true
|
||||||
overflow_delimited_expr = true
|
overflow_delimited_expr = true
|
||||||
struct_field_align_threshold = 60
|
struct_field_align_threshold = 60
|
||||||
tab_spaces = 2
|
tab_spaces = 2
|
||||||
unstable_features = true
|
unstable_features = true
|
||||||
use_field_init_shorthand = true
|
use_field_init_shorthand = true
|
||||||
use_try_shorthand = true
|
use_try_shorthand = true
|
||||||
wrap_comments = true
|
wrap_comments = true
|
||||||
|
|
|
||||||
13
.taplo.toml
Normal file
13
.taplo.toml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
[formatting]
|
||||||
|
align_entries = true
|
||||||
|
column_width = 110
|
||||||
|
compact_arrays = false
|
||||||
|
reorder_inline_tables = false
|
||||||
|
reorder_keys = true
|
||||||
|
|
||||||
|
[[rule]]
|
||||||
|
include = [ "**/Cargo.toml" ]
|
||||||
|
keys = [ "package" ]
|
||||||
|
|
||||||
|
[rule.formatting]
|
||||||
|
reorder_keys = false
|
||||||
126
Cargo.toml
126
Cargo.toml
|
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ncro"
|
name = "ncro"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
@ -7,12 +7,12 @@ license = "MIT"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.102"
|
anyhow = "1.0.102"
|
||||||
async-trait = "0.1.89"
|
async-trait = "0.1.89"
|
||||||
axum = { version = "0.8.9", features = ["macros"] }
|
axum = { version = "0.8.9", features = [ "macros" ] }
|
||||||
base64 = "0.22.1"
|
base64 = "0.22.1"
|
||||||
bytes = "1.11.1"
|
bytes = "1.11.1"
|
||||||
clap = { version = "4.6.1", features = ["derive", "env"] }
|
chrono = { version = "0.4.44", features = [ "serde" ] }
|
||||||
chrono = { version = "0.4.44", features = ["serde"] }
|
clap = { version = "4.6.1", features = [ "derive", "env" ] }
|
||||||
ed25519-dalek = { version = "2.2.0", features = ["rand_core"] }
|
ed25519-dalek = { version = "2.2.0", features = [ "rand_core" ] }
|
||||||
futures-util = "0.3.32"
|
futures-util = "0.3.32"
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
http = "1.4.0"
|
http = "1.4.0"
|
||||||
|
|
@ -21,12 +21,9 @@ humantime-serde = "1.1.1"
|
||||||
mdns-sd = "0.15.2"
|
mdns-sd = "0.15.2"
|
||||||
prometheus = "0.14.0"
|
prometheus = "0.14.0"
|
||||||
rand = "0.8.6"
|
rand = "0.8.6"
|
||||||
reqwest = { version = "0.12.28", default-features = false, features = [
|
reqwest = { version = "0.12.28", default-features = false, features = [ "rustls-tls", "stream" ] }
|
||||||
"rustls-tls",
|
|
||||||
"stream",
|
|
||||||
] }
|
|
||||||
rmp-serde = "1.3.1"
|
rmp-serde = "1.3.1"
|
||||||
serde = { version = "1.0.228", features = ["derive"] }
|
serde = { version = "1.0.228", features = [ "derive" ] }
|
||||||
serde_json = "1.0.149"
|
serde_json = "1.0.149"
|
||||||
serde_yaml = "0.9.34"
|
serde_yaml = "0.9.34"
|
||||||
sqlx = { version = "0.8.6", default-features = false, features = [
|
sqlx = { version = "0.8.6", default-features = false, features = [
|
||||||
|
|
@ -37,67 +34,60 @@ sqlx = { version = "0.8.6", default-features = false, features = [
|
||||||
"chrono",
|
"chrono",
|
||||||
] }
|
] }
|
||||||
thiserror = "2.0.18"
|
thiserror = "2.0.18"
|
||||||
tokio = { version = "1.52.3", features = [
|
tokio = { version = "1.52.3", features = [ "macros", "rt-multi-thread", "signal", "time", "net", "fs" ] }
|
||||||
"macros",
|
tokio-util = { version = "0.7.18", features = [ "io" ] }
|
||||||
"rt-multi-thread",
|
tower-http = { version = "0.6.10", features = [ "trace" ] }
|
||||||
"signal",
|
|
||||||
"time",
|
|
||||||
"net",
|
|
||||||
"fs",
|
|
||||||
] }
|
|
||||||
tokio-util = { version = "0.7.18", features = ["io"] }
|
|
||||||
tower-http = { version = "0.6.10", features = ["trace"] }
|
|
||||||
tracing = "0.1.44"
|
tracing = "0.1.44"
|
||||||
tracing-subscriber = { version = "0.3.23", features = ["env-filter", "json"] }
|
tracing-subscriber = { version = "0.3.23", features = [ "env-filter", "json" ] }
|
||||||
url = "2.5.8"
|
url = "2.5.8"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempfile = "3.27.0"
|
tempfile = "3.27.0"
|
||||||
tower = { version = "0.5.3", features = ["util"] }
|
tower = { version = "0.5.3", features = [ "util" ] }
|
||||||
|
|
||||||
# See:
|
# See:
|
||||||
# <https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html>
|
# <https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html>
|
||||||
[lints.clippy]
|
[lints.clippy]
|
||||||
cargo = { level = "warn", priority = -1 }
|
cargo = { level = "warn", priority = -1 }
|
||||||
complexity = { level = "warn", priority = -1 }
|
complexity = { level = "warn", priority = -1 }
|
||||||
nursery = { level = "warn", priority = -1 }
|
nursery = { level = "warn", priority = -1 }
|
||||||
pedantic = { level = "warn", priority = -1 }
|
pedantic = { level = "warn", priority = -1 }
|
||||||
perf = { level = "warn", priority = -1 }
|
perf = { level = "warn", priority = -1 }
|
||||||
style = { level = "warn", priority = -1 }
|
style = { level = "warn", priority = -1 }
|
||||||
|
|
||||||
# The lint groups above enable some less-than-desirable rules, we should manually
|
# The lint groups above enable some less-than-desirable rules, we should manually
|
||||||
# enable those to keep our sanity.
|
# enable those to keep our sanity.
|
||||||
absolute_paths = "allow"
|
absolute_paths = "allow"
|
||||||
arbitrary_source_item_ordering = "allow"
|
arbitrary_source_item_ordering = "allow"
|
||||||
clone_on_ref_ptr = "warn"
|
clone_on_ref_ptr = "warn"
|
||||||
dbg_macro = "warn"
|
dbg_macro = "warn"
|
||||||
empty_drop = "warn"
|
empty_drop = "warn"
|
||||||
empty_structs_with_brackets = "warn"
|
empty_structs_with_brackets = "warn"
|
||||||
exit = "warn"
|
exit = "warn"
|
||||||
filetype_is_file = "warn"
|
filetype_is_file = "warn"
|
||||||
get_unwrap = "warn"
|
get_unwrap = "warn"
|
||||||
implicit_return = "allow"
|
implicit_return = "allow"
|
||||||
infinite_loop = "warn"
|
infinite_loop = "warn"
|
||||||
map_with_unused_argument_over_ranges = "warn"
|
map_with_unused_argument_over_ranges = "warn"
|
||||||
missing_docs_in_private_items = "allow"
|
missing_docs_in_private_items = "allow"
|
||||||
multiple_crate_versions = "allow" # :(
|
multiple_crate_versions = "allow" # :(
|
||||||
non_ascii_literal = "allow"
|
non_ascii_literal = "allow"
|
||||||
non_std_lazy_statics = "warn"
|
non_std_lazy_statics = "warn"
|
||||||
pathbuf_init_then_push = "warn"
|
pathbuf_init_then_push = "warn"
|
||||||
pattern_type_mismatch = "allow"
|
pattern_type_mismatch = "allow"
|
||||||
question_mark_used = "allow"
|
question_mark_used = "allow"
|
||||||
rc_buffer = "warn"
|
rc_buffer = "warn"
|
||||||
rc_mutex = "warn"
|
rc_mutex = "warn"
|
||||||
rest_pat_in_fully_bound_structs = "warn"
|
rest_pat_in_fully_bound_structs = "warn"
|
||||||
similar_names = "allow"
|
similar_names = "allow"
|
||||||
single_call_fn = "allow"
|
single_call_fn = "allow"
|
||||||
std_instead_of_core = "allow"
|
std_instead_of_core = "allow"
|
||||||
too_long_first_doc_paragraph = "allow"
|
too_long_first_doc_paragraph = "allow"
|
||||||
too_many_lines = "allow"
|
too_many_lines = "allow"
|
||||||
undocumented_unsafe_blocks = "warn"
|
undocumented_unsafe_blocks = "warn"
|
||||||
unnecessary_safety_comment = "warn"
|
unnecessary_safety_comment = "warn"
|
||||||
unused_result_ok = "warn"
|
unused_result_ok = "warn"
|
||||||
unused_trait_names = "allow"
|
unused_trait_names = "allow"
|
||||||
|
|
||||||
# False positive:
|
# False positive:
|
||||||
# clippy's build script check doesn't recognize workspace-inherited metadata
|
# clippy's build script check doesn't recognize workspace-inherited metadata
|
||||||
|
|
@ -105,26 +95,26 @@ unused_trait_names = "allow"
|
||||||
cargo_common_metadata = "allow"
|
cargo_common_metadata = "allow"
|
||||||
|
|
||||||
# In the honor of a recent Cloudflare regression
|
# In the honor of a recent Cloudflare regression
|
||||||
panic = "deny"
|
panic = "deny"
|
||||||
unwrap_used = "deny"
|
unwrap_used = "deny"
|
||||||
|
|
||||||
# Less dangerous, but we'd like to know
|
# Less dangerous, but we'd like to know
|
||||||
# Those must be opt-in, and are fine ONLY in tests and examples. We *can* panic
|
# Those must be opt-in, and are fine ONLY in tests and examples. We *can* panic
|
||||||
# in NDG (the binary crate), but it should be very deliberate
|
# in NDG (the binary crate), but it should be very deliberate
|
||||||
expect_used = "warn"
|
expect_used = "warn"
|
||||||
print_stderr = "warn"
|
print_stderr = "warn"
|
||||||
print_stdout = "warn"
|
print_stdout = "warn"
|
||||||
todo = "warn"
|
todo = "warn"
|
||||||
unimplemented = "warn"
|
unimplemented = "warn"
|
||||||
unreachable = "warn"
|
unreachable = "warn"
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
debug = true
|
debug = true
|
||||||
opt-level = 0
|
opt-level = 0
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
lto = true
|
lto = true
|
||||||
opt-level = "z"
|
opt-level = "z"
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
strip = "symbols"
|
strip = "symbols"
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
rust-analyzer,
|
rust-analyzer,
|
||||||
rustc,
|
rustc,
|
||||||
rustfmt,
|
rustfmt,
|
||||||
|
taplo,
|
||||||
}:
|
}:
|
||||||
mkShell {
|
mkShell {
|
||||||
name = "rust";
|
name = "rust";
|
||||||
|
|
@ -19,5 +20,6 @@ mkShell {
|
||||||
rust-analyzer
|
rust-analyzer
|
||||||
clippy
|
clippy
|
||||||
(rustfmt.override {asNightly = true;})
|
(rustfmt.override {asNightly = true;})
|
||||||
|
taplo
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue