mirror of
https://github.com/ratspeak/rsReticulum
synced 2026-11-27 13:52:16 +00:00
ci: enforce strict Clippy across supported targets
This commit is contained in:
1 parent
eee619ef3b
commit
bc419b109d
6 files changed
+23
-25
No files matched your search
@@ -28,12 +28,12 @@ jobs:
|
||||
if: runner.os == 'Linux'
|
||||
run: sudo apt-get update && sudo apt-get install -y libudev-dev libdbus-1-dev pkg-config
|
||||
- name: Test (default features)
|
||||
run: cargo test --workspace
|
||||
run: cargo test --workspace --locked
|
||||
- name: Build application examples
|
||||
run: cargo build -p rns-runtime --examples
|
||||
run: cargo build -p rns-runtime --examples --locked
|
||||
- name: Test BLE interface features (Linux/macOS)
|
||||
if: runner.os != 'Windows'
|
||||
run: cargo test -p rns-interface --features ble
|
||||
run: cargo test -p rns-interface --features ble --locked
|
||||
|
||||
lint:
|
||||
name: Lint
|
||||
@@ -47,13 +47,12 @@ jobs:
|
||||
- name: Install system deps
|
||||
run: sudo apt-get update && sudo apt-get install -y libudev-dev libdbus-1-dev pkg-config
|
||||
- run: cargo fmt --all -- --check
|
||||
- run: cargo clippy --workspace --all-targets -- -D warnings
|
||||
- run: cargo clippy -p rns-interface --features ble --all-targets -- -D warnings
|
||||
- run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
|
||||
- name: Check public API documentation
|
||||
env:
|
||||
RUSTDOCFLAGS: "-D warnings"
|
||||
run: cargo doc --workspace --no-deps
|
||||
- run: cargo check --workspace --no-default-features
|
||||
run: cargo doc --workspace --no-deps --locked
|
||||
- run: cargo check --workspace --no-default-features --locked
|
||||
|
||||
msrv:
|
||||
name: Rust 1.85 MSRV
|
||||
@@ -62,9 +61,12 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: dtolnay/rust-toolchain@1.85.0
|
||||
with:
|
||||
components: clippy
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
cache-bin: false
|
||||
- name: Install system deps
|
||||
run: sudo apt-get update && sudo apt-get install -y libudev-dev libdbus-1-dev pkg-config
|
||||
- run: cargo check --workspace --all-targets
|
||||
- name: Clippy (all targets and features)
|
||||
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
|
||||
@@ -608,13 +608,13 @@ fn drop_worker_global_refs_attached(
|
||||
) {
|
||||
let connection = connection.take();
|
||||
let endpoint = endpoint.take();
|
||||
if let Some(vm) = JAVA_VM.get()
|
||||
&& let Ok(env) = vm.attach_current_thread()
|
||||
{
|
||||
drop(endpoint);
|
||||
drop(connection);
|
||||
drop(env);
|
||||
return;
|
||||
if let Some(vm) = JAVA_VM.get() {
|
||||
if let Ok(env) = vm.attach_current_thread() {
|
||||
drop(endpoint);
|
||||
drop(connection);
|
||||
drop(env);
|
||||
return;
|
||||
}
|
||||
}
|
||||
drop(endpoint);
|
||||
drop(connection);
|
||||
|
||||
@@ -2004,7 +2004,6 @@ mod tests {
|
||||
#[test]
|
||||
fn test_constants() {
|
||||
assert_eq!(HW_MTU, 1196);
|
||||
const { assert!(FIXED_MTU) };
|
||||
assert_eq!(DISCOVERY_PORT, 29716);
|
||||
assert_eq!(DATA_PORT, 42671);
|
||||
assert_eq!(UNICAST_DISCOVERY_PORT, 29717);
|
||||
|
||||
@@ -336,7 +336,6 @@ mod tests {
|
||||
#[test]
|
||||
fn test_weave_constants() {
|
||||
assert_eq!(HW_MTU, 1024);
|
||||
const { assert!(FIXED_MTU) };
|
||||
assert_eq!(PEERING_TIMEOUT, 20.0);
|
||||
assert_eq!(BITRATE_GUESS, 250_000);
|
||||
assert_eq!(DEFAULT_IFAC_SIZE, 16);
|
||||
|
||||
@@ -612,8 +612,8 @@ impl InboundResource {
|
||||
tracing::trace!(
|
||||
result = %format!("{:02x}{:02x}{:02x}{:02x}", mh[0], mh[1], mh[2], mh[3]),
|
||||
data_len = data.len(),
|
||||
data_first16 = %data.iter().take(16).map(|b| format!("{:02x}", b)).collect::<String>(),
|
||||
random_hash = %self.random_hash.iter().map(|b| format!("{:02x}", b)).collect::<String>(),
|
||||
data_first16 = %hex::encode(&data[..data.len().min(16)]),
|
||||
random_hash = %hex::encode(self.random_hash),
|
||||
random_len = self.random_hash.len(),
|
||||
"resource part map hash"
|
||||
);
|
||||
|
||||
@@ -849,12 +849,10 @@ impl Drop for InterfaceRegistration {
|
||||
stop_owned_task(&mut task, &mut driver, Some(id)).await;
|
||||
registry.mark_abandoned_pending(id, owner);
|
||||
});
|
||||
} else {
|
||||
if let Some(driver) = driver.take() {
|
||||
driver.request_shutdown();
|
||||
} else if let Some(task) = task.take() {
|
||||
task.abort();
|
||||
}
|
||||
} else if let Some(driver) = driver.take() {
|
||||
driver.request_shutdown();
|
||||
} else if let Some(task) = task.take() {
|
||||
task.abort();
|
||||
}
|
||||
// The exact owner remains fail-closed until the detached cleanup has
|
||||
// joined the task. During a runtime drain the coordinator claims the
|
||||
|
||||
Reference in new issue
Block a user