Skip to content

Commit

Permalink
Allow most low-info clippy warnings (#1419)
Browse files Browse the repository at this point in the history
Many clippy warnings are not very informative or are unlikely to be
usefully fixed any time soon. Allow them so that the remainder which
constitute a problem actually stand out and can be fixed.
  • Loading branch information
workingjubilee authored Nov 30, 2023
1 parent 7d1e8c1 commit d2bd29a
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions pgrx-examples/numeric/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//LICENSE All rights reserved.
//LICENSE
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#![allow(clippy::assign_op_pattern)]
use pgrx::prelude::*;

pg_module_magic!();
Expand Down
1 change: 1 addition & 0 deletions pgrx-sql-entity-graph/src/control_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ impl ControlFile {
/// # Ok(())
/// # }
/// ```
#[allow(clippy::should_implement_trait)]
pub fn from_str(input: &str) -> Result<Self, ControlFileError> {
let mut temp = HashMap::new();
for line in input.lines() {
Expand Down
1 change: 1 addition & 0 deletions pgrx-sql-entity-graph/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Rust to SQL mapping support.
to the `pgrx` framework and very subject to change between versions. While you may use this, please do it with caution.
*/
#![allow(clippy::too_many_arguments)]
pub use aggregate::entity::{AggregateTypeEntity, PgAggregateEntity};
pub use aggregate::{
AggregateType, AggregateTypeList, FinalizeModify, ParallelOption, PgAggregate,
Expand Down
1 change: 1 addition & 0 deletions pgrx-sql-entity-graph/src/pgrx_sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ fn build_base_edges(
}
}

#[allow(clippy::type_complexity)]
fn initialize_extension_sqls(
graph: &mut StableGraph<SqlGraphEntity, SqlGraphRelationship>,
root: NodeIndex,
Expand Down
1 change: 1 addition & 0 deletions pgrx/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//LICENSE All rights reserved.
//LICENSE
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#![allow(clippy::precedence)]
use crate::datum::Array;
use crate::pg_sys;
use crate::toast::{Toast, Toasty};
Expand Down
1 change: 1 addition & 0 deletions pgrx/src/bgworkers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//! Safely create Postgres Background Workers, including with full SPI support
//!
//! See: [https://www.postgresql.org/docs/current/bgworker.html](https://www.postgresql.org/docs/current/bgworker.html)
#![allow(clippy::useless_transmute)]
use crate::pg_sys;
use pgrx_pg_sys::PgTryBuilder;
use std::convert::TryInto;
Expand Down
1 change: 1 addition & 0 deletions pgrx/src/datum/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//LICENSE All rights reserved.
//LICENSE
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#![allow(clippy::question_mark)]
use crate::array::RawArray;
use crate::layout::*;
use crate::toast::Toast;
Expand Down
2 changes: 1 addition & 1 deletion pgrx/src/datum/from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//LICENSE
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
//! for converting a pg_sys::Datum and a corresponding "is_null" bool into a typed Option

#![allow(clippy::manual_map, clippy::map_clone, clippy::into_iter_on_ref)]
use crate::{
pg_sys, varlena, varlena_to_byte_slice, AllocatedByPostgres, IntoDatum, PgBox, PgMemoryContexts,
};
Expand Down
1 change: 1 addition & 0 deletions pgrx/src/datum/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
//! Handing for easily converting Postgres Datum types into their corresponding Rust types
//! and converting Rust types into their corresponding Postgres types
#![allow(clippy::unused_unit)]
mod anyarray;
mod anyelement;
mod array;
Expand Down
1 change: 1 addition & 0 deletions pgrx/src/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
//LICENSE
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
//! A trait and registration system for hooking Postgres internal operations such as its planner and executor
#![allow(clippy::unit_arg)]
use crate as pgrx; // for #[pg_guard] support from within ourself
use crate::prelude::*;
use crate::{void_mut_ptr, PgBox, PgList};
Expand Down
1 change: 1 addition & 0 deletions pgrx/src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//LICENSE All rights reserved.
//LICENSE
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#![allow(clippy::vec_init_then_push)]
use std::iter::once;

use crate::IntoHeapTuple;
Expand Down
10 changes: 8 additions & 2 deletions pgrx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@
//! }
//!
//! ```
#![allow(clippy::missing_safety_doc)]
#![allow(clippy::cast_ptr_alignment)]
#![allow(
clippy::cast_ptr_alignment,
clippy::len_without_is_empty,
clippy::missing_safety_doc,
clippy::too_many_arguments,
clippy::type_complexity,
clippy::unnecessary_cast
)]

#[macro_use]
extern crate bitflags;
Expand Down
1 change: 1 addition & 0 deletions pgrx/src/lwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//LICENSE All rights reserved.
//LICENSE
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#![allow(clippy::needless_borrow)]
use crate::pg_sys;
use core::ops::{Deref, DerefMut};
use once_cell::sync::OnceCell;
Expand Down

0 comments on commit d2bd29a

Please sign in to comment.