Convert Clippy allows to expects (#18906)

This commit is contained in:
Charlie Marsh
2026-04-07 14:47:08 -04:00
committed by GitHub
parent d22a54b137
commit bfb4d2804d
16 changed files with 17 additions and 22 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
// instead. But that's a monster. On the other hand, applying this suppression
// instruction more granularly is annoying. So we just slap it on the module
// for now. ---AG
#![allow(clippy::redundant_closure_for_method_calls)]
#![expect(clippy::redundant_closure_for_method_calls)]
use std::borrow::Cow;
use std::ops::Bound;
+1 -1
View File
@@ -6,7 +6,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(clippy::cast_sign_loss)]
#![expect(clippy::cast_sign_loss)]
use std::{
io::{BufReader, Cursor, Read, Seek, SeekFrom},
+1 -1
View File
@@ -905,7 +905,7 @@ fn create_symlink(original: &Path, link: &Path) -> io::Result<()> {
}
#[cfg(test)]
#[allow(clippy::print_stderr)]
#[expect(clippy::print_stderr)]
mod tests {
use super::*;
use tempfile::TempDir;
+1 -1
View File
@@ -1,4 +1,4 @@
#![allow(clippy::print_stdout)]
#![expect(clippy::print_stdout)]
use globset::GlobSetBuilder;
use std::env::args;
+1 -2
View File
@@ -4076,8 +4076,7 @@ impl TryFrom<SourceWire> for Source {
type Error = LockError;
fn try_from(wire: SourceWire) -> Result<Self, LockError> {
#[allow(clippy::enum_glob_use)]
use self::SourceWire::*;
use self::SourceWire::{Direct, Directory, Editable, Git, Path, Registry, Virtual};
match wire {
Registry { registry } => Ok(Self::Registry(registry.into())),
+1 -2
View File
@@ -1852,7 +1852,6 @@ impl TestContext {
}
/// For when we add pypy to the test suite.
#[allow(clippy::unused_self)]
pub fn python_kind(&self) -> &'static str {
"python"
}
@@ -2171,7 +2170,7 @@ pub fn run_and_format_with_status<T: AsRef<str>>(
// Support profiling test run commands with traces.
if let Ok(root) = env::var(EnvVars::TRACING_DURATIONS_TEST_ROOT) {
// We only want to fail if the variable is set at runtime.
#[allow(clippy::assertions_on_constants)]
#[expect(clippy::assertions_on_constants)]
{
assert!(
cfg!(feature = "tracing-durations-export"),
-1
View File
@@ -1,4 +1,3 @@
#![allow(clippy::disallowed_types)]
use std::ffi::CString;
use std::path::{Path, PathBuf};
use std::vec::Vec;
+1 -1
View File
@@ -84,6 +84,6 @@ pub fn spawn_child(cmd: &mut Command, hide_console: bool) -> std::io::Result<Inf
unsafe { GetExitCodeProcess(supervised.raw_handle(), &raw mut exit_code) }
.map_err(|e| std::io::Error::other(format!("Failed to get exit code: {e}")))?;
#[allow(clippy::exit, clippy::cast_possible_wrap)]
#[expect(clippy::exit, clippy::cast_possible_wrap)]
std::process::exit(exit_code as i32)
}
+1 -1
View File
@@ -1,4 +1,4 @@
#![allow(clippy::single_match_else)]
#![expect(clippy::single_match_else)]
use std::collections::{BTreeMap, BTreeSet};
use std::fmt::Write;
+1 -1
View File
@@ -11,7 +11,7 @@
#![allow(unsafe_code)]
// Usually we want fs_err over std::fs, but there's no advantage here, we don't
// report errors encountered while reporting an exception.
#![allow(clippy::disallowed_types)]
#![expect(clippy::disallowed_types)]
use std::fmt::Write;
use std::fs::File;
+1 -1
View File
@@ -1,4 +1,4 @@
#![allow(clippy::disallowed_types)]
#![expect(clippy::disallowed_types)]
#[cfg(feature = "test-git")]
mod conditional_imports {
+1 -1
View File
@@ -1,4 +1,4 @@
#![allow(clippy::disallowed_types)]
#![expect(clippy::disallowed_types)]
use anyhow::{Ok, Result};
use assert_cmd::assert::OutputAssertExt;
+2 -3
View File
@@ -4,9 +4,8 @@
//! Scenarios from <https://github.com/astral-sh/packse/tree/0.3.59/scenarios>
//!
#![cfg(all(feature = "test-python", feature = "test-pypi"))]
#![allow(clippy::needless_raw_string_hashes)]
#![allow(clippy::doc_markdown)]
#![allow(clippy::doc_lazy_continuation)]
#![expect(clippy::needless_raw_string_hashes)]
#![expect(clippy::doc_markdown)]
use anyhow::Result;
use assert_cmd::assert::OutputAssertExt;
+1 -1
View File
@@ -1,4 +1,4 @@
#![allow(clippy::disallowed_types)]
#![expect(clippy::disallowed_types)]
use std::env::current_dir;
use std::fs;
+1 -1
View File
@@ -1,4 +1,4 @@
#![allow(clippy::disallowed_types)]
#![expect(clippy::disallowed_types)]
use anyhow::Result;
use assert_cmd::assert::OutputAssertExt;
+2 -3
View File
@@ -4,9 +4,8 @@
//! Scenarios from <{{generated_from}}>
//!
#![cfg(all(feature = "test-python", feature = "test-pypi"))]
#![allow(clippy::needless_raw_string_hashes)]
#![allow(clippy::doc_markdown)]
#![allow(clippy::doc_lazy_continuation)]
#![expect(clippy::needless_raw_string_hashes)]
#![expect(clippy::doc_markdown)]
use anyhow::Result;
use assert_cmd::assert::OutputAssertExt;