Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implemented optional disabling of invalid cross reference warnings.

  • Loading branch information...
commit 7aa04af8dfae8c71f01896ab7b59c3508098e14a 1 parent 765e84a
tomaz authored
3  Application/GBApplicationSettingsProvider.h
View
@@ -243,6 +243,9 @@
*/
@property (assign) BOOL warnOnUndocumentedMember;
+/** Indicates whether invalid cross reference should result in warning or not. */
+@property (assign) BOOL warnOnInvalidCrossReference;
+
///---------------------------------------------------------------------------------------
/// @name Application-wide HTML helpers
///---------------------------------------------------------------------------------------
2  Application/GBApplicationSettingsProvider.m
View
@@ -65,6 +65,7 @@ - (id)init {
self.warnOnMissingCompanyIdentifier = YES;
self.warnOnUndocumentedObject = YES;
self.warnOnUndocumentedMember = YES;
+ self.warnOnInvalidCrossReference = YES;
self.docsetBundleIdentifier = @"$COMPANYID.$PROJECT";
self.docsetBundleName = @"$PROJECT Documentation";
@@ -327,6 +328,7 @@ - (NSString *)description {
@synthesize warnOnMissingCompanyIdentifier;
@synthesize warnOnUndocumentedObject;
@synthesize warnOnUndocumentedMember;
+@synthesize warnOnInvalidCrossReference;
@synthesize commentComponents;
@synthesize stringTemplates;
2  Model/GBClassData.m
View
@@ -44,7 +44,7 @@ - (void)mergeDataFromObject:(id)source {
if (![self nameOfSuperclass]) {
self.nameOfSuperclass = sourceClass.nameOfSuperclass;
} else if (sourceClass.nameOfSuperclass && ![self.nameOfSuperclass isEqualToString:sourceClass.nameOfSuperclass]) {
- GBLogWarn(@"%@: Merged class's %@ superclass is different from ours!", self, sourceClass);
+ GBLogWarn(@"%@: Merged class's %@ superclass is different from current!", self, sourceClass);
}
// Forward merging request to components.
2  Model/GBComment.m
View
@@ -94,7 +94,7 @@ - (void)registerCrossReference:(GBParagraphLinkItem *)ref {
for (NSUInteger i=0; i<[_crossrefs count]; i++) {
GBParagraphLinkItem *existing = [_crossrefs objectAtIndex:i];
if ([existing.stringValue isEqualToString:ref.stringValue]) {
- GBLogWarn(@"%@: %@ is already registered, ignoring!", self, ref.stringValue);
+ GBLogWarn(@"%@: %@ cross reference is already registered, ignoring!", self, ref.stringValue);
return;
}
}
9 Processing/GBCommentsProcessor.m
View
@@ -240,7 +240,10 @@ - (GBParagraphLinkItem *)linkArgumentFromString:(NSString *)string usingRegex:(N
// Prepare the resulting link item. Note that we must first test for remote member reference!
if (length) *length = linkRange.location + linkRange.length;
GBParagraphLinkItem *item = [self remoteMemberLinkItemFromString:reference matchRange:NULL];
- if (!item) item = [self simpleLinkItemFromString:reference matchRange:NULL];
+ if (!item) {
+ item = [self simpleLinkItemFromString:reference matchRange:NULL];
+ if (!item && self.settings.warnOnInvalidCrossReference) GBLogWarn(@"%@: Invalid cross reference %@!", self.currentComment.sourceInfo, reference);
+ }
return item;
}
@@ -633,7 +636,7 @@ - (GBParagraphLinkItem *)remoteMemberLinkItemFromString:(NSString *)string match
}
}
if (!objectRefence) {
- GBLogWarn(@"%@: Invalid %@ reference: %@ not found!", self.currentComment.sourceInfo, reference, objectName);
+ if (self.settings.warnOnInvalidCrossReference) GBLogWarn(@"%@: Invalid %@ reference: %@ not found!", self.currentComment.sourceInfo, reference, objectName);
return nil;
}
@@ -649,7 +652,7 @@ - (GBParagraphLinkItem *)remoteMemberLinkItemFromString:(NSString *)string match
link.isLocal = NO;
return link;
} else {
- GBLogWarn(@"%@: Invalid %@ reference: member %@ not found for %@!", self.currentComment.sourceInfo, reference, memberName, objectRefence);
+ if (self.settings.warnOnInvalidCrossReference) GBLogWarn(@"%@: Invalid %@ reference: member %@ not found for %@!", self.currentComment.sourceInfo, reference, memberName, objectRefence);
return nil;
}
Please sign in to comment.
Something went wrong with that request. Please try again.