Skip to content

Commit e914935

Browse files
chakkk309alambJefffrey
authored
chore: enforce clippy::allow_attributes for 7 crates (#19133)
## Which issue does this PR close? Part of #18881 ## Rationale for this change Implement clippy::allow_attributes lint for 7 crates ## What changes are included in this PR? Core crates modified: - datafusion-doc - datafusion-execution - datafusion-expr - datafusion-expr-common - datafusion-catalog-listing - datafusion-core - datafusion-proto-common ## Are these changes tested? yes ## Are there any user-facing changes? No --------- Co-authored-by: Andrew Lamb <[email protected]> Co-authored-by: Jefffrey <[email protected]>
1 parent 5496c30 commit e914935

File tree

18 files changed

+28
-18
lines changed

18 files changed

+28
-18
lines changed

datafusion/catalog-listing/src/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
#![deny(clippy::allow_attributes)]
1819
#![cfg_attr(test, allow(clippy::needless_pass_by_value))]
1920
#![doc(
2021
html_logo_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg",

datafusion/core/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
#![deny(clippy::allow_attributes)]
1819
#![doc(
1920
html_logo_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg",
2021
html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg"
@@ -35,6 +36,8 @@
3536
)
3637
)]
3738
#![warn(missing_docs, clippy::needless_borrow)]
39+
// Use `allow` instead of `expect` for test configuration to explicitly
40+
// disable the lint for all test code rather than expecting violations
3841
#![cfg_attr(test, allow(clippy::needless_pass_by_value))]
3942

4043
//! [DataFusion] is an extensible query engine written in Rust that

datafusion/doc/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18+
#![deny(clippy::allow_attributes)]
1819
#![cfg_attr(test, allow(clippy::needless_pass_by_value))]
1920
#![doc(
2021
html_logo_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg",

datafusion/execution/src/disk_manager.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,10 @@ pub enum DiskManagerMode {
115115
}
116116

117117
/// Configuration for temporary disk access
118-
#[allow(deprecated)]
119118
#[deprecated(since = "48.0.0", note = "Use DiskManagerBuilder instead")]
120119
#[derive(Debug, Clone, Default)]
120+
#[allow(clippy::allow_attributes)]
121+
#[allow(deprecated)]
121122
pub enum DiskManagerConfig {
122123
/// Use the provided [DiskManager] instance
123124
Existing(Arc<DiskManager>),
@@ -135,7 +136,7 @@ pub enum DiskManagerConfig {
135136
Disabled,
136137
}
137138

138-
#[allow(deprecated)]
139+
#[expect(deprecated)]
139140
impl DiskManagerConfig {
140141
/// Create temporary files in a temporary directory chosen by the OS
141142
pub fn new() -> Self {
@@ -177,7 +178,7 @@ impl DiskManager {
177178
}
178179

179180
/// Create a DiskManager given the configuration
180-
#[allow(deprecated)]
181+
#[expect(deprecated)]
181182
#[deprecated(since = "48.0.0", note = "Use DiskManager::builder() instead")]
182183
pub fn try_new(config: DiskManagerConfig) -> Result<Arc<Self>> {
183184
match config {

datafusion/execution/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
// https://github.com/apache/datafusion/issues/11143
2525
#![deny(clippy::clone_on_ref_ptr)]
2626
#![cfg_attr(test, allow(clippy::needless_pass_by_value))]
27+
#![deny(clippy::allow_attributes)]
2728

2829
//! DataFusion execution configuration and runtime structures
2930

datafusion/execution/src/object_store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ pub trait ObjectStoreRegistry: Send + Sync + std::fmt::Debug + 'static {
158158

159159
/// Deregister the store previously registered with the same key. Returns the
160160
/// deregistered store if it existed.
161-
#[allow(unused_variables)]
161+
#[expect(unused_variables)]
162162
fn deregister_store(&self, url: &Url) -> Result<Arc<dyn ObjectStore>> {
163163
not_impl_err!(
164164
"ObjectStoreRegistry::deregister_store is not implemented for this ObjectStoreRegistry"

datafusion/execution/src/runtime_env.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//! Execution [`RuntimeEnv`] environment that manages access to object
1919
//! store, memory manager, disk manager.
2020
21-
#[allow(deprecated)]
21+
#[expect(deprecated)]
2222
use crate::disk_manager::DiskManagerConfig;
2323
use crate::{
2424
disk_manager::{DiskManager, DiskManagerBuilder, DiskManagerMode},
@@ -279,7 +279,7 @@ impl Default for RuntimeEnv {
279279
/// See example on [`RuntimeEnv`]
280280
#[derive(Clone)]
281281
pub struct RuntimeEnvBuilder {
282-
#[allow(deprecated)]
282+
#[expect(deprecated)]
283283
/// DiskManager to manage temporary disk file usage
284284
pub disk_manager: DiskManagerConfig,
285285
/// DiskManager builder to manager temporary disk file usage
@@ -317,7 +317,7 @@ impl RuntimeEnvBuilder {
317317
}
318318
}
319319

320-
#[allow(deprecated)]
320+
#[expect(deprecated)]
321321
#[deprecated(since = "48.0.0", note = "Use with_disk_manager_builder instead")]
322322
/// Customize disk manager
323323
pub fn with_disk_manager(mut self, disk_manager: DiskManagerConfig) -> Self {
@@ -418,7 +418,7 @@ impl RuntimeEnvBuilder {
418418
disk_manager: if let Some(builder) = disk_manager_builder {
419419
Arc::new(builder.build()?)
420420
} else {
421-
#[allow(deprecated)]
421+
#[expect(deprecated)]
422422
DiskManager::try_new(disk_manager)?
423423
},
424424
cache_manager: CacheManager::try_new(&cache_manager)?,
@@ -451,7 +451,7 @@ impl RuntimeEnvBuilder {
451451
};
452452

453453
Self {
454-
#[allow(deprecated)]
454+
#[expect(deprecated)]
455455
disk_manager: DiskManagerConfig::Existing(Arc::clone(
456456
&runtime_env.disk_manager,
457457
)),

datafusion/expr-common/src/dyn_eq.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use std::hash::{Hash, Hasher};
2828
///
2929
/// Note: This trait should not be implemented directly. Implement `Eq` and `Any` and use
3030
/// the blanket implementation.
31-
#[allow(private_bounds)]
31+
#[expect(private_bounds)]
3232
pub trait DynEq: private::EqSealed {
3333
fn dyn_eq(&self, other: &dyn Any) -> bool;
3434
}
@@ -45,7 +45,7 @@ impl<T: Eq + Any> DynEq for T {
4545
///
4646
/// Note: This trait should not be implemented directly. Implement `Hash` and `Any` and use
4747
/// the blanket implementation.
48-
#[allow(private_bounds)]
48+
#[expect(private_bounds)]
4949
pub trait DynHash: private::HashSealed {
5050
fn dyn_hash(&self, _state: &mut dyn Hasher);
5151
}

datafusion/expr-common/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
// https://github.com/apache/datafusion/issues/11143
3333
#![deny(clippy::clone_on_ref_ptr)]
3434
#![cfg_attr(test, allow(clippy::needless_pass_by_value))]
35+
#![deny(clippy::allow_attributes)]
3536

3637
pub mod accumulator;
3738
pub mod casts;

datafusion/expr/src/expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2104,7 +2104,7 @@ impl Expr {
21042104

21052105
impl Normalizeable for Expr {
21062106
fn can_normalize(&self) -> bool {
2107-
#[allow(clippy::match_like_matches_macro)]
2107+
#[expect(clippy::match_like_matches_macro)]
21082108
match self {
21092109
Expr::BinaryExpr(BinaryExpr {
21102110
op:

0 commit comments

Comments
 (0)