Permalink
Browse files

Added settings for enabling or disabling various processing warnings.

  • Loading branch information...
1 parent 022d674 commit 4f44437115d3f4c1c8a9f687815a676599478c9d @tomaz committed Jan 17, 2011
@@ -294,12 +294,20 @@
*/
@property (assign) BOOL warnOnUndocumentedObject;
-/** Indicates whether appldoc will warn if it encounters an undocumented method or property.
+/** Indicates whether appledoc will warn if it encounters an undocumented method or property.
@see warnOnUndocumentedObject
*/
@property (assign) BOOL warnOnUndocumentedMember;
+/** Indicates whether appledoc will warn if it encounters an empty description (@bug, @warning, example section etc.).
+ */
+@property (assign) BOOL warnOnEmptyDescription;
+
+/** Indicates whether appledoc will warn if it encounters unknown directive or styling element.
+ */
+@property (assign) BOOL warnOnUnknownDirective;
+
/** Indicates whether invalid cross reference should result in warning or not. */
@property (assign) BOOL warnOnInvalidCrossReference;
@@ -84,6 +84,8 @@ - (id)init {
self.warnOnMissingCompanyIdentifier = YES;
self.warnOnUndocumentedObject = YES;
self.warnOnUndocumentedMember = YES;
+ self.warnOnEmptyDescription = YES;
+ self.warnOnUnknownDirective = YES;
self.warnOnInvalidCrossReference = YES;
self.warnOnMissingMethodArgument = YES;
@@ -381,6 +383,8 @@ - (NSString *)versionIdentifier {
@synthesize warnOnMissingCompanyIdentifier;
@synthesize warnOnUndocumentedObject;
@synthesize warnOnUndocumentedMember;
+@synthesize warnOnEmptyDescription;
+@synthesize warnOnUnknownDirective;
@synthesize warnOnInvalidCrossReference;
@synthesize warnOnMissingMethodArgument;
@@ -156,7 +156,7 @@ - (BOOL)registerWarningBlockFromlines:(NSArray *)lines {
NSString *string = [NSString stringByCombiningLines:lines delimitWith:@"\n"];
NSString *description = [string stringByMatching:regex capture:1];
if ([description length] == 0) {
- GBLogWarn(@"Empty @warning block found in %@!", self.sourceFileInfo);
+ if (self.settings.warnOnEmptyDescription) GBLogWarn(@"Empty @warning block found at %@!", self.sourceFileInfo);
return YES;
}
GBLogDebug(@" - Found warning block '%@' at %@.", [string normalizedDescription], self.sourceFileInfo);
@@ -185,7 +185,7 @@ - (BOOL)registerBugBlockFromLines:(NSArray *)lines {
NSString *string = [NSString stringByCombiningLines:lines delimitWith:@"\n"];
NSString *description = [string stringByMatching:regex capture:1];
if ([description length] == 0) {
- GBLogWarn(@"Empty @bug block found in %@!", self.sourceFileInfo);
+ if (self.settings.warnOnEmptyDescription) GBLogWarn(@"Empty @bug block found at %@!", self.sourceFileInfo);
return YES;
}
GBLogDebug(@" - Found bug block '%@' at %@.", [string normalizedDescription], self.sourceFileInfo);
@@ -223,7 +223,11 @@ - (BOOL)registerExampleBlockFromLines:(NSArray *)lines {
if ([stringValue length] > 0) [stringValue appendString:@"\n"];
NSString *lineText = [captures objectAtIndex:2];
[stringValue appendString:lineText];
- }];
+ }];
+ if ([stringValue length] == 0) {
+ if (self.settings.warnOnEmptyDescription) GBLogWarn(@"Found empty example block at %@!", self.sourceFileInfo);
+ return YES;
+ }
GBLogDebug(@" - Found example block '%@' at %@.", [stringValue normalizedDescription], self.sourceFileInfo);
// If there isn't paragraph registered yet, create one now, otherwise we'll just add the block to previous paragraph.
@@ -423,7 +427,7 @@ - (BOOL)registerDirectivesBlockFromLines:(NSArray *)lines {
}
// If the line doesn't contain known directive, warn the user.
- GBLogWarn(@"Found unknown directive '%@' at %@!", directive, sourceInfo);
+ if (self.settings.warnOnUnknownDirective) GBLogWarn(@"Found unknown directive '%@' at %@!", directive, sourceInfo);
}];
return YES;
@@ -483,7 +487,7 @@ - (void)registerTextItemsFromStringToCurrentParagraph:(NSString *)string {
[paragraph registerItem:decorator];
decorator = nil;
} else {
- GBLogWarn(@"Unknown text decorator type %@ detected at %@!", type, self.sourceFileInfo);
+ if (self.settings.warnOnUnknownDirective) GBLogWarn(@"Unknown text decorator type %@ detected at %@!", type, self.sourceFileInfo);
decorator = nil;
}

0 comments on commit 4f44437

Please sign in to comment.