-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trailing whitespace in otherwise empty lines between conditionals of isEqual: return statement #15
Comments
Note that this applies to the generated code. |
Can you provide an example of the trailing whitespace in the generated code? |
The definition
results in the generated code: - (BOOL) isEqual:(id)other {
if (other == self) {
return YES;
}
if (![other isKindOfClass:[Demo class]]) {
return NO;
}
Demo *otherMessage = other;
return
self.hasDemoField1 == otherMessage.hasDemoField1 &&
(!self.hasDemoField1 || [self.demoField1 isEqual:otherMessage.demoField1]) &&
self.hasDemoField2 == otherMessage.hasDemoField2 &&
(!self.hasDemoField2 || [self.demoField2 isEqual:otherMessage.demoField2]) &&
self.hasDemoField3 == otherMessage.hasDemoField3 &&
(!self.hasDemoField3 || [self.demoField3 isEqual:otherMessage.demoField3]) &&
self.hasDemoField4 == otherMessage.hasDemoField4 &&
(!self.hasDemoField4 || [self.demoField4 isEqual:otherMessage.demoField4]) &&
self.hasDemoField5 == otherMessage.hasDemoField5 &&
(!self.hasDemoField5 || [self.demoField5 isEqual:otherMessage.demoField5]) &&
self.hasDemoField6 == otherMessage.hasDemoField6 &&
(!self.hasDemoField6 || [self.demoField6 isEqual:otherMessage.demoField6]) &&
(self.unknownFields == otherMessage.unknownFields || (self.unknownFields != nil && [self.unknownFields isEqual:otherMessage.unknownFields]));
} The trailing whitespace is on the otherwise empty lines in the return statement. |
Just recompiled with these fixes and found one more case. Here's the patch to fix it: diff --git a/src/compiler/objc_enum_field.cc b/src/compiler/objc_enum_field.cc
index b85be1b..5e29026 100644
--- a/src/compiler/objc_enum_field.cc
+++ b/src/compiler/objc_enum_field.cc
@@ -215,7 +215,7 @@ namespace google { namespace protobuf { namespace compiler { namespace objective
void EnumFieldGenerator::GenerateIsEqualCodeSource(io::Printer* printer) const {
printer->Print(variables_,
"self.has$capitalized_name$ == otherMessage.has$capitalized_name$ &&\n"
- "(!self.has$capitalized_name$ || self.$name$ != otherMessage.$name$) &&\n");
+ "(!self.has$capitalized_name$ || self.$name$ != otherMessage.$name$) &&");
}
|
jparise
pushed a commit
that referenced
this issue
Nov 15, 2011
This should complete the work for #15.
Packetdancer
pushed a commit
to Packetdancer/protobuf-objc
that referenced
this issue
Feb 4, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This issue is present in commit 60ac436
Trailing whitespace should be eliminated for ease of use with repositories that reject commits with trailing whitespace.
The text was updated successfully, but these errors were encountered: