Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion py/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: Apache-2.0

// This happens in PyO3 generated code, and there doesn't seem to be a more
// These happen in PyO3 generated code, and there doesn't seem to be a more
// narrow scope that this can be disabled in (clippy seems a bit confused about
// the code causing the warning, in general).
#![allow(clippy::needless_option_as_deref)]
#![allow(clippy::borrow_deref_ref)]

use pyo3::exceptions::PyValueError;
use pyo3::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion rs/src/export/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mod proto;
use crate::output::parse_result;

/// Supported output formats for exporting.
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Format {
/// Emit a newline-separated, flattened list of diagnostics.
Diagnostics,
Expand Down
3 changes: 2 additions & 1 deletion rs/src/input/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ use crate::output::primitive_data;

use heck::ToUpperCamelCase;

#[allow(clippy::large_enum_variant)]
#[allow(clippy::large_enum_variant)] // caused by generated code
#[allow(clippy::derive_partial_eq_without_eq)] // caused by generated code
pub mod substrait {
include!(concat!(env!("OUT_DIR"), "/substrait.rs"));
pub mod extensions {
Expand Down
10 changes: 5 additions & 5 deletions rs/src/output/comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::output::path;

/// Representation of a comment message intended only for human consumption.
/// Includes basic formatting information.
#[derive(Clone, Debug, PartialEq, Default)]
#[derive(Clone, Debug, PartialEq, Eq, Default)]
pub struct Comment {
/// Formatting elements and spans that make up the comment.
elements: Vec<Element>,
Expand Down Expand Up @@ -176,7 +176,7 @@ impl From<String> for Comment {
}

/// A comment element.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Element {
/// A span of text. Should not include newlines.
Span(Span),
Expand All @@ -195,7 +195,7 @@ pub enum Element {
}

/// Like Comment, but single-line.
#[derive(Clone, Debug, PartialEq, Default)]
#[derive(Clone, Debug, PartialEq, Default, Eq)]
pub struct Brief {
/// Spans that make up the comment. These are simply concatenated, but
/// spans may contain optional formatting information.
Expand Down Expand Up @@ -293,7 +293,7 @@ impl From<Brief> for Comment {
}

/// A span of text within a comment.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Span {
/// The span of text.
pub text: String,
Expand Down Expand Up @@ -331,7 +331,7 @@ fn merge_spans(mut a: Span, b: Span) -> (Span, Option<Span>) {
}

/// A link to something.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Link {
/// Link to another node in the tree, via an absolute node path.
Path(path::PathBuf),
Expand Down
10 changes: 5 additions & 5 deletions rs/src/output/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl<T> std::fmt::Display for Reference<T> {
}

/// User-defined type class.
#[derive(Clone, Debug, PartialEq, Default)]
#[derive(Clone, Debug, PartialEq, Eq, Default)]
pub struct DataType {
/// The underlying structure of the type.
pub structure: Vec<(String, data_type::Simple)>,
Expand All @@ -132,7 +132,7 @@ pub struct DataType {
}

/// A parameter slot for a user-defined data type.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct DataTypeParameterSlot {
/// YAML-provided name of the parameter.
pub name: String,
Expand All @@ -149,7 +149,7 @@ pub struct DataTypeParameterSlot {
}

/// Expected metatype and bounds for a type parameter.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum DataTypeParameterBounds {
/// The parameter must be bound to a (nested) data type.
DataType,
Expand Down Expand Up @@ -209,7 +209,7 @@ impl TypeVariation {
}

/// Type variation function behavior.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum FunctionBehavior {
Inherits,
Separate,
Expand All @@ -222,7 +222,7 @@ impl Default for FunctionBehavior {
}

/// Function extension.
#[derive(Clone, Debug, PartialEq, Default)]
#[derive(Clone, Debug, PartialEq, Eq, Default)]
pub struct Function {
// TODO: need much more information here to do type checking.
}
Expand Down
2 changes: 1 addition & 1 deletion rs/src/output/parse_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::output::tree;
/// are more sensible in the context of a diagnostic, while the names for
/// Validity are more sensible when talking about a validation result as a
/// whole.
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Validity {
/// The plan is valid.
Valid,
Expand Down
4 changes: 2 additions & 2 deletions rs/src/output/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use crate::util;

/// Element of a path to some field of a protobuf message and/or YAML file.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum PathElement {
/// Refers to an optional protobuf field with the given name within the
/// message, or a YAML map entry with the given key.
Expand Down Expand Up @@ -63,7 +63,7 @@ impl PathElement {
}

/// Refers to a location within a protobuf message.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PathBuf {
pub root: &'static str,
pub elements: Vec<PathElement>,
Expand Down
2 changes: 1 addition & 1 deletion rs/src/output/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ pub enum NodeType {
}

/// Semantical information about a node.
#[derive(Clone, Copy, Debug, PartialEq)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Class {
/// Used for nodes for which no better classification exists.
Misc,
Expand Down
2 changes: 1 addition & 1 deletion rs/src/parse/expressions/literals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ fn parse_interval_year_to_month(
}
});
let months = x.months.saturating_add(x.years.saturating_mul(12));
if months < -120000 || months > 120000 {
if !(-120000..=120000).contains(&months) {
diagnostic!(
y,
Error,
Expand Down
2 changes: 1 addition & 1 deletion rs/src/parse/expressions/references/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Default for Root {
}

/// Description of a reference path.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ReferencePath {
// *Reversed* list of segments.
segments: Vec<String>,
Expand Down
7 changes: 3 additions & 4 deletions rs/src/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
//! - returning as many diagnostics as possible, rather than just stopping
//! at the first sight of trouble.
//!
//! Diagnostics can be pushed into the parser context using the [`diagnostic!`]
//! and [`ediagnostic!`] macros. The latter allows third-party `Err` types to
//! Diagnostics can be pushed into the parser context using the `diagnostic!`
//! and `ediagnostic!` macros. The latter allows third-party `Err` types to
//! be pushed as the message, the former uses a [format!] syntax. However,
//! sometimes it also very useful to just use the `?` operator for something.
//! Therefore, parse functions also return
Expand All @@ -74,8 +74,7 @@
//! found in the docs for the [diagnostic](crate::output::diagnostic) module.
//!
//! Beyond diagnostics, it's also possible to push comments into the context.
//! This can be done using the [`comment!`] and [`link!`] macros, or, for more
//! control, by pushing a []
//! This can be done using the `comment!` and `link!` macros.
//!
//! ## Data types
//!
Expand Down