Skip to content

Commit

Permalink
chore(build): Ignore clippy warning derive_partial_eq_without_eq (#775)
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Dec 9, 2022
1 parent cd2796c commit d531ba7
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
4 changes: 4 additions & 0 deletions prost-build/src/code_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ impl<'a> CodeGenerator<'a> {
self.append_doc(&fq_message_name, None);
self.append_type_attributes(&fq_message_name);
self.push_indent();
self.buf
.push_str("#[allow(clippy::derive_partial_eq_without_eq)]\n");
self.buf.push_str(&format!(
"#[derive(Clone, PartialEq, {}::Message)]\n",
self.config.prost_path.as_deref().unwrap_or("::prost")
Expand Down Expand Up @@ -505,6 +507,8 @@ impl<'a> CodeGenerator<'a> {
let oneof_name = format!("{}.{}", fq_message_name, oneof.name());
self.append_type_attributes(&oneof_name);
self.push_indent();
self.buf
.push_str("#[allow(clippy::derive_partial_eq_without_eq)]\n");
self.buf.push_str(&format!(
"#[derive(Clone, PartialEq, {}::Oneof)]\n",
self.config.prost_path.as_deref().unwrap_or("::prost")
Expand Down
4 changes: 4 additions & 0 deletions prost-types/src/compiler.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/// The version number of protocol compiler.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Version {
#[prost(int32, optional, tag = "1")]
Expand All @@ -13,6 +14,7 @@ pub struct Version {
pub suffix: ::core::option::Option<::prost::alloc::string::String>,
}
/// An encoded CodeGeneratorRequest is written to the plugin's stdin.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CodeGeneratorRequest {
/// The .proto files that were explicitly listed on the command-line. The
Expand Down Expand Up @@ -44,6 +46,7 @@ pub struct CodeGeneratorRequest {
pub compiler_version: ::core::option::Option<Version>,
}
/// The plugin writes an encoded CodeGeneratorResponse to stdout.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CodeGeneratorResponse {
/// Error message. If non-empty, code generation failed. The plugin process
Expand All @@ -66,6 +69,7 @@ pub struct CodeGeneratorResponse {
/// Nested message and enum types in `CodeGeneratorResponse`.
pub mod code_generator_response {
/// Represents a single generated file.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct File {
/// The file name, relative to the output directory. The name must not
Expand Down
44 changes: 44 additions & 0 deletions prost-types/src/protobuf.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/// The protocol compiler can output a FileDescriptorSet containing the .proto
/// files it parses.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileDescriptorSet {
#[prost(message, repeated, tag = "1")]
pub file: ::prost::alloc::vec::Vec<FileDescriptorProto>,
}
/// Describes a complete .proto file.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileDescriptorProto {
/// file name, relative to root of source tree
Expand Down Expand Up @@ -47,6 +49,7 @@ pub struct FileDescriptorProto {
pub syntax: ::core::option::Option<::prost::alloc::string::String>,
}
/// Describes a message type.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DescriptorProto {
#[prost(string, optional, tag = "1")]
Expand Down Expand Up @@ -74,6 +77,7 @@ pub struct DescriptorProto {
}
/// Nested message and enum types in `DescriptorProto`.
pub mod descriptor_proto {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExtensionRange {
/// Inclusive.
Expand All @@ -88,6 +92,7 @@ pub mod descriptor_proto {
/// Range of reserved tag numbers. Reserved tag numbers may not be used by
/// fields or extension ranges in the same message. Reserved ranges may
/// not overlap.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReservedRange {
/// Inclusive.
Expand All @@ -98,13 +103,15 @@ pub mod descriptor_proto {
pub end: ::core::option::Option<i32>,
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExtensionRangeOptions {
/// The parser stores options it doesn't recognize here. See above.
#[prost(message, repeated, tag = "999")]
pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
}
/// Describes a field within a message.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FieldDescriptorProto {
#[prost(string, optional, tag = "1")]
Expand Down Expand Up @@ -280,6 +287,7 @@ pub mod field_descriptor_proto {
}
}
/// Describes a oneof.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OneofDescriptorProto {
#[prost(string, optional, tag = "1")]
Expand All @@ -288,6 +296,7 @@ pub struct OneofDescriptorProto {
pub options: ::core::option::Option<OneofOptions>,
}
/// Describes an enum type.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EnumDescriptorProto {
#[prost(string, optional, tag = "1")]
Expand Down Expand Up @@ -316,6 +325,7 @@ pub mod enum_descriptor_proto {
/// Note that this is distinct from DescriptorProto.ReservedRange in that it
/// is inclusive such that it can appropriately represent the entire int32
/// domain.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EnumReservedRange {
/// Inclusive.
Expand All @@ -327,6 +337,7 @@ pub mod enum_descriptor_proto {
}
}
/// Describes a value within an enum.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EnumValueDescriptorProto {
#[prost(string, optional, tag = "1")]
Expand All @@ -337,6 +348,7 @@ pub struct EnumValueDescriptorProto {
pub options: ::core::option::Option<EnumValueOptions>,
}
/// Describes a service.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceDescriptorProto {
#[prost(string, optional, tag = "1")]
Expand All @@ -347,6 +359,7 @@ pub struct ServiceDescriptorProto {
pub options: ::core::option::Option<ServiceOptions>,
}
/// Describes a method of a service.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MethodDescriptorProto {
#[prost(string, optional, tag = "1")]
Expand Down Expand Up @@ -395,6 +408,7 @@ pub struct MethodDescriptorProto {
/// <https://developers.google.com/protocol-buffers/docs/proto#options>
/// If this turns out to be popular, a web service will be set up
/// to automatically assign option numbers.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileOptions {
/// Sets the Java package where classes generated from this .proto will be
Expand Down Expand Up @@ -549,6 +563,7 @@ pub mod file_options {
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageOptions {
/// Set true to use the old proto1 MessageSet wire format for extensions.
Expand Down Expand Up @@ -609,6 +624,7 @@ pub struct MessageOptions {
#[prost(message, repeated, tag = "999")]
pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FieldOptions {
/// The ctype option instructs the C++ code generator to use a different
Expand Down Expand Up @@ -756,12 +772,14 @@ pub mod field_options {
}
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OneofOptions {
/// The parser stores options it doesn't recognize here. See above.
#[prost(message, repeated, tag = "999")]
pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EnumOptions {
/// Set this option to true to allow mapping different tag names to the same
Expand All @@ -778,6 +796,7 @@ pub struct EnumOptions {
#[prost(message, repeated, tag = "999")]
pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EnumValueOptions {
/// Is this enum value deprecated?
Expand All @@ -790,6 +809,7 @@ pub struct EnumValueOptions {
#[prost(message, repeated, tag = "999")]
pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ServiceOptions {
/// Is this service deprecated?
Expand All @@ -802,6 +822,7 @@ pub struct ServiceOptions {
#[prost(message, repeated, tag = "999")]
pub uninterpreted_option: ::prost::alloc::vec::Vec<UninterpretedOption>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MethodOptions {
/// Is this method deprecated?
Expand Down Expand Up @@ -865,6 +886,7 @@ pub mod method_options {
/// options protos in descriptor objects (e.g. returned by Descriptor::options(),
/// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
/// in them.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UninterpretedOption {
#[prost(message, repeated, tag = "2")]
Expand All @@ -891,6 +913,7 @@ pub mod uninterpreted_option {
/// extension (denoted with parentheses in options specs in .proto files).
/// E.g.,{ \["foo", false\], \["bar.baz", true\], \["qux", false\] } represents
/// "foo.(bar.baz).qux".
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NamePart {
#[prost(string, required, tag = "1")]
Expand All @@ -901,6 +924,7 @@ pub mod uninterpreted_option {
}
/// Encapsulates information about the original source file from which a
/// FileDescriptorProto was generated.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SourceCodeInfo {
/// A Location identifies a piece of source code in a .proto file which
Expand Down Expand Up @@ -952,6 +976,7 @@ pub struct SourceCodeInfo {
}
/// Nested message and enum types in `SourceCodeInfo`.
pub mod source_code_info {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Location {
/// Identifies which part of the FileDescriptorProto was defined at this
Expand Down Expand Up @@ -1046,6 +1071,7 @@ pub mod source_code_info {
/// Describes the relationship between generated code and its original source
/// file. A GeneratedCodeInfo message is associated with only one generated
/// source file, but may contain references to different source .proto files.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GeneratedCodeInfo {
/// An Annotation connects some span of text in generated code to an element
Expand All @@ -1055,6 +1081,7 @@ pub struct GeneratedCodeInfo {
}
/// Nested message and enum types in `GeneratedCodeInfo`.
pub mod generated_code_info {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Annotation {
/// Identifies the element in the original source .proto file. This field
Expand Down Expand Up @@ -1168,6 +1195,7 @@ pub mod generated_code_info {
/// "value": "1.212s"
/// }
/// ```
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Any {
/// A URL/resource name that uniquely identifies the type of the serialized
Expand Down Expand Up @@ -1205,6 +1233,7 @@ pub struct Any {
}
/// `SourceContext` represents information about the source of a
/// protobuf element, like the file in which it is defined.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SourceContext {
/// The path-qualified name of the .proto file that contained the associated
Expand All @@ -1213,6 +1242,7 @@ pub struct SourceContext {
pub file_name: ::prost::alloc::string::String,
}
/// A protocol buffer message type.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Type {
/// The fully qualified message name.
Expand All @@ -1235,6 +1265,7 @@ pub struct Type {
pub syntax: i32,
}
/// A single field of a message type.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Field {
/// The field type.
Expand Down Expand Up @@ -1393,6 +1424,7 @@ pub mod field {
}
}
/// Enum type definition.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Enum {
/// Enum type name.
Expand All @@ -1412,6 +1444,7 @@ pub struct Enum {
pub syntax: i32,
}
/// Enum value definition.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EnumValue {
/// Enum value name.
Expand All @@ -1426,6 +1459,7 @@ pub struct EnumValue {
}
/// A protocol buffer option, which can be attached to a message, field,
/// enumeration, etc.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Option {
/// The option's name. For protobuf built-in options (options defined in
Expand Down Expand Up @@ -1471,6 +1505,7 @@ impl Syntax {
/// sometimes simply referred to as "APIs" in other contexts, such as the name of
/// this message itself. See <https://cloud.google.com/apis/design/glossary> for
/// detailed terminology.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Api {
/// The fully qualified name of this interface, including package name
Expand Down Expand Up @@ -1516,6 +1551,7 @@ pub struct Api {
pub syntax: i32,
}
/// Method represents a method of an API interface.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Method {
/// The simple name of this method.
Expand Down Expand Up @@ -1628,6 +1664,7 @@ pub struct Method {
/// ...
/// }
/// ```
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Mixin {
/// The fully qualified name of the interface which is included.
Expand Down Expand Up @@ -1702,6 +1739,7 @@ pub struct Mixin {
/// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
/// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
/// microsecond should be expressed in JSON format as "3.000001s".
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Duration {
/// Signed seconds of the span of time. Must be from -315,576,000,000
Expand Down Expand Up @@ -1940,6 +1978,7 @@ pub struct Duration {
/// The implementation of any API method which has a FieldMask type field in the
/// request should verify the included field paths, and return an
/// `INVALID_ARGUMENT` error if any path is unmappable.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FieldMask {
/// The set of field mask paths.
Expand All @@ -1954,6 +1993,7 @@ pub struct FieldMask {
/// with the proto support for the language.
///
/// The JSON representation for `Struct` is JSON object.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Struct {
/// Unordered map of dynamically typed values.
Expand All @@ -1969,6 +2009,7 @@ pub struct Struct {
/// variants. Absence of any variant indicates an error.
///
/// The JSON representation for `Value` is JSON value.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Value {
/// The kind of value.
Expand All @@ -1978,6 +2019,7 @@ pub struct Value {
/// Nested message and enum types in `Value`.
pub mod value {
/// The kind of value.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Kind {
/// Represents a null value.
Expand All @@ -2003,6 +2045,7 @@ pub mod value {
/// `ListValue` is a wrapper around a repeated field of values.
///
/// The JSON representation for `ListValue` is JSON array.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListValue {
/// Repeated field of dynamically typed values.
Expand Down Expand Up @@ -2129,6 +2172,7 @@ impl NullValue {
/// \[`strftime`\](<https://docs.python.org/2/library/time.html#time.strftime>) with
/// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
/// the Joda Time's \[`ISODateTimeFormat.dateTime()`\](<http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D>) to obtain a formatter capable of generating timestamps in this format.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Timestamp {
/// Represents seconds of UTC time since Unix epoch
Expand Down

0 comments on commit d531ba7

Please sign in to comment.