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 acd2da77b0 Enable `allow_attributes` lint workspace-wide (#10720)
acd2da77b0 is described below
commit acd2da77b097005fe568a37edfb4dec5a780ab07
Author: WaterWhisperer <[email protected]>
AuthorDate: Tue Aug 18 13:53:06 2026 +0800
Enable `allow_attributes` lint workspace-wide (#10720)
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax.
-->
- Closes #10458.
# Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly
in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.
-->
Since all workspace crates have now been migrated, the lint can be
enabled at the workspace level.
# What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it
is sometimes worth providing a summary of the individual changes in this
PR.
-->
- Enable `clippy::allow_attributes` in the workspace lint config.
- Remove the temporary crate-level lint declarations.
- Update the lint suppression guidance in `CONTRIBUTING.md`.
# Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
If this PR claims a performance improvement, please include evidence
such as benchmark results.
-->
Yes. Format, clippy for all workspace targets and features, nightly
documentation, and relevant crate tests pass.
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be
updated before approving the PR.
If there are any breaking changes to public APIs, please call them out.
-->
No.
---
CONTRIBUTING.md | 2 +-
Cargo.toml | 1 +
arrow-arith/src/lib.rs | 1 -
arrow-array/src/lib.rs | 1 -
arrow-avro/src/lib.rs | 1 -
arrow-buffer/src/lib.rs | 1 -
arrow-cast/src/lib.rs | 1 -
arrow-cmp/src/lib.rs | 1 -
arrow-csv/src/lib.rs | 1 -
arrow-data/src/lib.rs | 1 -
arrow-flight/gen/src/main.rs | 2 --
arrow-flight/src/lib.rs | 1 -
arrow-integration-test/src/lib.rs | 1 -
arrow-integration-testing/src/lib.rs | 1 -
arrow-ipc/src/lib.rs | 1 -
arrow-json/src/lib.rs | 1 -
arrow-ord/src/lib.rs | 1 -
arrow-pyarrow/src/lib.rs | 2 --
arrow-row/src/lib.rs | 1 -
arrow-schema/src/lib.rs | 1 -
arrow-select/src/lib.rs | 1 -
arrow-string/src/lib.rs | 1 -
arrow/src/lib.rs | 1 -
parquet-geospatial/src/lib.rs | 1 -
parquet-variant-compute/src/lib.rs | 2 --
parquet-variant-json/src/lib.rs | 2 --
parquet-variant/src/lib.rs | 2 --
parquet/src/lib.rs | 1 -
parquet_derive/src/lib.rs | 1 -
parquet_derive_test/src/lib.rs | 1 -
30 files changed, 2 insertions(+), 34 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 5ff7cc98ab..0dee2975b2 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -203,7 +203,7 @@ rather than to individual crates, so that they apply
everywhere.
One of the concerns with `clippy` is that it often produces a lot of false
positives, or that some recommendations may hurt readability. We do not have a
policy of which lints are ignored, but if you disagree with a `clippy` lint,
you may disable the lint and briefly justify it.
-Search for `allow(clippy::` in the codebase to identify lints that are
ignored/allowed. We currently prefer ignoring lints on the lowest unit possible.
+Search for `expect(clippy::` in the codebase to identify lints that are
intentionally suppressed. We currently prefer suppressing lints on the lowest
unit possible.
- If you are introducing a line that returns a lint warning or error, you may
disable the lint on that line.
- If you have several lints on a function or module, you may disable the lint
on the function or module.
diff --git a/Cargo.toml b/Cargo.toml
index 5b2a9874f9..1fbf4e038d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -154,6 +154,7 @@ broken_intra_doc_links = "warn"
missing_crate_level_docs = "warn"
[workspace.lints.clippy]
+allow_attributes = "warn"
as_ptr_cast_mut = "warn"
assigning_clones = "warn"
bool_to_int_with_if = "warn"
diff --git a/arrow-arith/src/lib.rs b/arrow-arith/src/lib.rs
index 9568ae0934..035519ed99 100644
--- a/arrow-arith/src/lib.rs
+++ b/arrow-arith/src/lib.rs
@@ -22,7 +22,6 @@
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)]
pub mod aggregate;
#[doc(hidden)] // Kernels to be removed in a future release
diff --git a/arrow-array/src/lib.rs b/arrow-array/src/lib.rs
index a2e5f7033e..a5f9bf5e71 100644
--- a/arrow-array/src/lib.rs
+++ b/arrow-array/src/lib.rs
@@ -226,7 +226,6 @@
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)]
#![deny(rustdoc::broken_intra_doc_links)]
#![warn(missing_docs)]
diff --git a/arrow-avro/src/lib.rs b/arrow-avro/src/lib.rs
index 2b8a309485..634f9d7389 100644
--- a/arrow-avro/src/lib.rs
+++ b/arrow-avro/src/lib.rs
@@ -217,7 +217,6 @@
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)]
/// Core functionality for reading Avro data into Arrow arrays
diff --git a/arrow-buffer/src/lib.rs b/arrow-buffer/src/lib.rs
index 8f76ed7cc6..230747b8b8 100644
--- a/arrow-buffer/src/lib.rs
+++ b/arrow-buffer/src/lib.rs
@@ -37,7 +37,6 @@
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)]
pub mod alloc;
diff --git a/arrow-cast/src/lib.rs b/arrow-cast/src/lib.rs
index 15e757974f..3412616c5c 100644
--- a/arrow-cast/src/lib.rs
+++ b/arrow-cast/src/lib.rs
@@ -22,7 +22,6 @@
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)]
pub mod cast;
pub use cast::*;
diff --git a/arrow-cmp/src/lib.rs b/arrow-cmp/src/lib.rs
index 368ef9921c..79f20b7e84 100644
--- a/arrow-cmp/src/lib.rs
+++ b/arrow-cmp/src/lib.rs
@@ -29,7 +29,6 @@
//! downstream user of `arrow-array` to compile the comparator machinery
whether
//! they need it or not.
-#![deny(clippy::allow_attributes)]
#![deny(rustdoc::broken_intra_doc_links)]
#![warn(missing_docs)]
diff --git a/arrow-csv/src/lib.rs b/arrow-csv/src/lib.rs
index c3c650dcea..4c4b040981 100644
--- a/arrow-csv/src/lib.rs
+++ b/arrow-csv/src/lib.rs
@@ -24,7 +24,6 @@
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)]
pub mod reader;
diff --git a/arrow-data/src/lib.rs b/arrow-data/src/lib.rs
index d0b4bc4394..07e7553b2b 100644
--- a/arrow-data/src/lib.rs
+++ b/arrow-data/src/lib.rs
@@ -24,7 +24,6 @@
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 data;
pub use data::*;
diff --git a/arrow-flight/gen/src/main.rs b/arrow-flight/gen/src/main.rs
index 7a6193373c..08254ff2b2 100644
--- a/arrow-flight/gen/src/main.rs
+++ b/arrow-flight/gen/src/main.rs
@@ -17,8 +17,6 @@
//! Generates the Rust bindings for the Arrow Flight protobuf definitions.
-#![deny(clippy::allow_attributes)]
-
use std::{fs::OpenOptions, io::Write, path::Path};
fn main() -> Result<(), Box<dyn std::error::Error>> {
diff --git a/arrow-flight/src/lib.rs b/arrow-flight/src/lib.rs
index 7a87b2338c..b66fd5cc65 100644
--- a/arrow-flight/src/lib.rs
+++ b/arrow-flight/src/lib.rs
@@ -42,7 +42,6 @@
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)]
#![allow(rustdoc::invalid_html_tags)]
#![warn(missing_docs)]
// The unused_crate_dependencies lint does not work well for crates defining
additional examples/bin targets
diff --git a/arrow-integration-test/src/lib.rs
b/arrow-integration-test/src/lib.rs
index e294aced03..5f5d1fe433 100644
--- a/arrow-integration-test/src/lib.rs
+++ b/arrow-integration-test/src/lib.rs
@@ -34,7 +34,6 @@
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)]
use arrow_buffer::{IntervalDayTime, IntervalMonthDayNano, ScalarBuffer};
use hex::decode;
diff --git a/arrow-integration-testing/src/lib.rs
b/arrow-integration-testing/src/lib.rs
index 25a1ce15a1..613408ae59 100644
--- a/arrow-integration-testing/src/lib.rs
+++ b/arrow-integration-testing/src/lib.rs
@@ -19,7 +19,6 @@
// The unused_crate_dependencies lint does not work well for crates defining
additional examples/bin targets
#![allow(unused_crate_dependencies)]
-#![deny(clippy::allow_attributes)]
#![warn(missing_docs)]
use serde_json::Value;
diff --git a/arrow-ipc/src/lib.rs b/arrow-ipc/src/lib.rs
index 54a75d0b96..584b11c78a 100644
--- a/arrow-ipc/src/lib.rs
+++ b/arrow-ipc/src/lib.rs
@@ -43,7 +43,6 @@
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)]
pub mod convert;
pub mod reader;
diff --git a/arrow-json/src/lib.rs b/arrow-json/src/lib.rs
index 44f545b614..7f0f272b8b 100644
--- a/arrow-json/src/lib.rs
+++ b/arrow-json/src/lib.rs
@@ -80,7 +80,6 @@
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)]
#![deny(rustdoc::broken_intra_doc_links)]
#![warn(missing_docs)]
diff --git a/arrow-ord/src/lib.rs b/arrow-ord/src/lib.rs
index f26f876d5d..9388007826 100644
--- a/arrow-ord/src/lib.rs
+++ b/arrow-ord/src/lib.rs
@@ -48,7 +48,6 @@
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)]
pub mod cmp;
#[doc(hidden)]
diff --git a/arrow-pyarrow/src/lib.rs b/arrow-pyarrow/src/lib.rs
index c1f56b315e..01d482e76d 100644
--- a/arrow-pyarrow/src/lib.rs
+++ b/arrow-pyarrow/src/lib.rs
@@ -69,8 +69,6 @@
//! Input hints name the pyarrow classes only, and are therefore narrower than
what is accepted: the
//! PyCapsule interface is duck-typed and has no canonical Python type to name.
-#![deny(clippy::allow_attributes)]
-
use std::convert::{From, TryFrom};
use std::ffi::CStr;
use std::ptr::NonNull;
diff --git a/arrow-row/src/lib.rs b/arrow-row/src/lib.rs
index 8e6f70c84b..14d7d8ccff 100644
--- a/arrow-row/src/lib.rs
+++ b/arrow-row/src/lib.rs
@@ -158,7 +158,6 @@
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)]
use std::cmp::Ordering;
use std::hash::{Hash, Hasher};
diff --git a/arrow-schema/src/lib.rs b/arrow-schema/src/lib.rs
index 0d2ce0d56b..4f6771a1c9 100644
--- a/arrow-schema/src/lib.rs
+++ b/arrow-schema/src/lib.rs
@@ -22,7 +22,6 @@
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 datatype;
diff --git a/arrow-select/src/lib.rs b/arrow-select/src/lib.rs
index 2c5e300557..33c1ee8ddb 100644
--- a/arrow-select/src/lib.rs
+++ b/arrow-select/src/lib.rs
@@ -22,7 +22,6 @@
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)]
pub mod coalesce;
diff --git a/arrow-string/src/lib.rs b/arrow-string/src/lib.rs
index 43ad45cf44..77c8e6050a 100644
--- a/arrow-string/src/lib.rs
+++ b/arrow-string/src/lib.rs
@@ -22,7 +22,6 @@
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/src/lib.rs b/arrow/src/lib.rs
index d0c970ca7b..48ab42e84c 100644
--- a/arrow/src/lib.rs
+++ b/arrow/src/lib.rs
@@ -393,7 +393,6 @@
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)]
#![deny(clippy::redundant_clone)]
#![warn(missing_debug_implementations)]
#![warn(missing_docs)]
diff --git a/parquet-geospatial/src/lib.rs b/parquet-geospatial/src/lib.rs
index 006cb08f79..6e038c4131 100644
--- a/parquet-geospatial/src/lib.rs
+++ b/parquet-geospatial/src/lib.rs
@@ -20,7 +20,6 @@
//! [Geometry and Geography Encoding]:
https://github.com/apache/parquet-format/blob/master/Geospatial.md
//! [Apache Parquet]: https://parquet.apache.org/
-#![deny(clippy::allow_attributes)]
pub mod bounding;
pub mod interval;
pub mod testing;
diff --git a/parquet-variant-compute/src/lib.rs
b/parquet-variant-compute/src/lib.rs
index 46d04b8c66..f1e87661c8 100644
--- a/parquet-variant-compute/src/lib.rs
+++ b/parquet-variant-compute/src/lib.rs
@@ -15,8 +15,6 @@
// specific language governing permissions and limitations
// under the License.
-#![deny(clippy::allow_attributes)]
-
//! [`VariantArray`] and compute kernels for the [Variant Binary Encoding]
from [Apache Parquet].
//!
//! ## Main APIs
diff --git a/parquet-variant-json/src/lib.rs b/parquet-variant-json/src/lib.rs
index b5b7c6a3f5..6b42b15bd4 100644
--- a/parquet-variant-json/src/lib.rs
+++ b/parquet-variant-json/src/lib.rs
@@ -31,8 +31,6 @@
//!
//! [Variant issue]: https://github.com/apache/arrow-rs/issues/6736
-#![deny(clippy::allow_attributes)]
-
mod from_json;
mod to_json;
diff --git a/parquet-variant/src/lib.rs b/parquet-variant/src/lib.rs
index 1e1820b20f..a57b470979 100644
--- a/parquet-variant/src/lib.rs
+++ b/parquet-variant/src/lib.rs
@@ -31,8 +31,6 @@
//!
//! [Variant issue]: https://github.com/apache/arrow-rs/issues/6736
-#![warn(clippy::allow_attributes)]
-
mod builder;
mod decoder;
mod path;
diff --git a/parquet/src/lib.rs b/parquet/src/lib.rs
index eb5aac0465..3acdb61884 100644
--- a/parquet/src/lib.rs
+++ b/parquet/src/lib.rs
@@ -143,7 +143,6 @@
html_favicon_url =
"https://raw.githubusercontent.com/apache/parquet-format/25f05e73d8cd7f5c83532ce51cb4f4de8ba5f2a2/logo/parquet-logos_1.svg"
)]
#![cfg_attr(docsrs, feature(doc_cfg))]
-#![deny(clippy::allow_attributes)]
#![warn(missing_docs)]
/// Defines a an item with an experimental public API
///
diff --git a/parquet_derive/src/lib.rs b/parquet_derive/src/lib.rs
index 4a960048eb..34cb1c8dd8 100644
--- a/parquet_derive/src/lib.rs
+++ b/parquet_derive/src/lib.rs
@@ -23,7 +23,6 @@
html_favicon_url =
"https://raw.githubusercontent.com/apache/parquet-format/25f05e73d8cd7f5c83532ce51cb4f4de8ba5f2a2/logo/parquet-logos_1.svg"
)]
#![cfg_attr(docsrs, feature(doc_cfg))]
-#![deny(clippy::allow_attributes)]
#![warn(missing_docs)]
#![recursion_limit = "128"]
diff --git a/parquet_derive_test/src/lib.rs b/parquet_derive_test/src/lib.rs
index 6706ef622d..106e0b4732 100644
--- a/parquet_derive_test/src/lib.rs
+++ b/parquet_derive_test/src/lib.rs
@@ -22,7 +22,6 @@
html_favicon_url =
"https://raw.githubusercontent.com/apache/parquet-format/25f05e73d8cd7f5c83532ce51cb4f4de8ba5f2a2/logo/parquet-logos_1.svg"
)]
#![cfg_attr(docsrs, feature(doc_cfg))]
-#![deny(clippy::allow_attributes)]
#![allow(clippy::approx_constant)]
use parquet_derive::{ParquetRecordReader, ParquetRecordWriter};