This is an automated email from the ASF dual-hosted git repository.

Jefffrey pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new e7ae89c1a2 Enable allow_attributes lint for arrow-string (#10482)
e7ae89c1a2 is described below

commit e7ae89c1a2fe7f2b2e78735ef0b55a4580b2520e
Author: Hashim Khan <[email protected]>
AuthorDate: Sun Aug 2 07:57:46 2026 +0500

    Enable allow_attributes lint for arrow-string (#10482)
    
    ## Which issue does this PR close?
    
    Part of #10458.
    
    ## Rationale for this change
    
    Enable `clippy::allow_attributes` for `arrow-string` so future lint
    suppressions use expectations and stale suppressions are detectable. The
    existing `large_enum_variant` suppressions are still required on x86_64
    Linux, so they are converted to target-specific `expect` attributes
    instead of unconditional `allow` attributes.
    
    ## What changes are included in this PR?
    
    - Deny `clippy::allow_attributes` in the `arrow-string` crate.
    - Convert the two x86_64 Linux `large_enum_variant` suppressions to lint
    expectations.
    
    ## Are there any user-facing changes?
    
    No.
    
    ## How was this change tested?
    
    - `cargo +1.96.1 fmt --all -- --check`
    - `cargo +1.96.1 clippy -p arrow-string --all-targets --all-features --
    -D warnings`
    - `cargo +1.96.1 clippy -p arrow-string --target
    x86_64-unknown-linux-gnu --all-targets --all-features -- -D warnings`
    - `cargo +1.96.1 test -p arrow-string --all-features` (182 unit tests
    and 10 doc tests passed)
    
    ## AI assistance
    
    AI assistance was used to identify the lint occurrences and draft the
    minimal edits. I reviewed the full diff and validated it with
    formatting, Clippy, and the crate's tests.
    
    ---------
    
    Signed-off-by: Hashim Khan <[email protected]>
    Co-authored-by: Hashim1999164 <[email protected]>
---
 arrow-string/src/binary_predicate.rs | 2 +-
 arrow-string/src/lib.rs              | 1 +
 arrow-string/src/predicate.rs        | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arrow-string/src/binary_predicate.rs 
b/arrow-string/src/binary_predicate.rs
index 590a34b10e..1f9fcb8f33 100644
--- a/arrow-string/src/binary_predicate.rs
+++ b/arrow-string/src/binary_predicate.rs
@@ -21,7 +21,7 @@ use memchr::memmem::Finder;
 use std::iter::zip;
 
 /// A binary based predicate
-#[allow(clippy::large_enum_variant)]
+#[cfg_attr(target_arch = "x86_64", expect(clippy::large_enum_variant))]
 pub enum BinaryPredicate<'a> {
     Contains(Finder<'a>),
     StartsWith(&'a [u8]),
diff --git a/arrow-string/src/lib.rs b/arrow-string/src/lib.rs
index 77c8e6050a..43ad45cf44 100644
--- a/arrow-string/src/lib.rs
+++ b/arrow-string/src/lib.rs
@@ -22,6 +22,7 @@
     html_favicon_url = 
"https://arrow.apache.org/img/arrow-logo_chevrons_black-txt_transparent-bg.svg";
 )]
 #![cfg_attr(docsrs, feature(doc_cfg))]
+#![deny(clippy::allow_attributes)]
 #![warn(missing_docs)]
 
 mod binary_like;
diff --git a/arrow-string/src/predicate.rs b/arrow-string/src/predicate.rs
index 8523129dba..3b454209f0 100644
--- a/arrow-string/src/predicate.rs
+++ b/arrow-string/src/predicate.rs
@@ -24,7 +24,7 @@ use regex::{Regex, RegexBuilder};
 use std::iter::zip;
 
 /// A string based predicate
-#[allow(clippy::large_enum_variant)]
+#[cfg_attr(target_arch = "x86_64", expect(clippy::large_enum_variant))]
 pub(crate) enum Predicate<'a> {
     Eq(&'a str),
     Contains(Finder<'a>),

Reply via email to