Permalink
Browse files

Merge pull request #273 from sirwart/master

Add the ability to suppress warnings for undocumented parameters
  • Loading branch information...
2 parents 3d23114 + 1558b36 commit 5f763f2f1baeceb98c1044c1734d2f64391235da @tomaz committed Nov 29, 2012
Showing with 11 additions and 1 deletion.
  1. +4 −0 Application/GBAppledocApplication.m
  2. +6 −0 Application/GBApplicationSettingsProvider.h
  3. +1 −1 Processing/GBProcessor.m
@@ -61,6 +61,7 @@
static NSString *kGBArgWarnOnMissingCompanyIdentifier = @"warn-missing-company-id";
static NSString *kGBArgWarnOnUndocumentedObject = @"warn-undocumented-object";
static NSString *kGBArgWarnOnUndocumentedMember = @"warn-undocumented-member";
+static NSString *kGBArgWarnOnUndocumentedParam = @"warn-undocumented-param";
static NSString *kGBArgWarnOnEmptyDescription = @"warn-empty-description";
static NSString *kGBArgWarnOnUnknownDirective = @"warn-unknown-directive";
static NSString *kGBArgWarnOnInvalidCrossReference = @"warn-invalid-crossref";
@@ -301,6 +302,7 @@ - (void)application:(DDCliApplication *)app willParseOptions:(DDGetoptLongParser
{ kGBArgWarnOnMissingCompanyIdentifier, 0, DDGetoptNoArgument },
{ kGBArgWarnOnUndocumentedObject, 0, DDGetoptNoArgument },
{ kGBArgWarnOnUndocumentedMember, 0, DDGetoptNoArgument },
+ { kGBArgWarnOnUndocumentedParam, 0, DDGetoptNoArgument },
{ kGBArgWarnOnEmptyDescription, 0, DDGetoptNoArgument },
{ kGBArgWarnOnUnknownDirective, 0, DDGetoptNoArgument },
{ kGBArgWarnOnInvalidCrossReference, 0, DDGetoptNoArgument },
@@ -925,6 +927,7 @@ - (void)printSettingsAndArguments:(NSArray *)arguments {
ddprintf(@"--%@ = %@\n", kGBArgWarnOnMissingCompanyIdentifier, PRINT_BOOL(self.settings.warnOnMissingCompanyIdentifier));
ddprintf(@"--%@ = %@\n", kGBArgWarnOnUndocumentedObject, PRINT_BOOL(self.settings.warnOnUndocumentedObject));
ddprintf(@"--%@ = %@\n", kGBArgWarnOnUndocumentedMember, PRINT_BOOL(self.settings.warnOnUndocumentedMember));
+ ddprintf(@"--%@ = %@\n", kGBArgWarnOnUndocumentedParam, PRINT_BOOL(self.settings.warnOnUndocumentedParam));
ddprintf(@"--%@ = %@\n", kGBArgWarnOnEmptyDescription, PRINT_BOOL(self.settings.warnOnEmptyDescription));
ddprintf(@"--%@ = %@\n", kGBArgWarnOnUnknownDirective, PRINT_BOOL(self.settings.warnOnUnknownDirective));
ddprintf(@"--%@ = %@\n", kGBArgWarnOnInvalidCrossReference, PRINT_BOOL(self.settings.warnOnInvalidCrossReference));
@@ -993,6 +996,7 @@ - (void)printHelp {
PRINT_USAGE(@" ", kGBArgWarnOnMissingCompanyIdentifier, @"", @"[b] Warn if company ID is not given");
PRINT_USAGE(@" ", kGBArgWarnOnUndocumentedObject, @"", @"[b] Warn on undocumented object");
PRINT_USAGE(@" ", kGBArgWarnOnUndocumentedMember, @"", @"[b] Warn on undocumented member");
+ PRINT_USAGE(@" ", kGBArgWarnOnUndocumentedParam, @"", @"[b] Warn on undocumented method parameter");
PRINT_USAGE(@" ", kGBArgWarnOnEmptyDescription, @"", @"[b] Warn on empty description block");
PRINT_USAGE(@" ", kGBArgWarnOnUnknownDirective, @"", @"[b] Warn on unknown directive or format");
PRINT_USAGE(@" ", kGBArgWarnOnInvalidCrossReference, @"", @"[b] Warn on invalid cross reference");
@@ -391,6 +391,12 @@ extern id kGBCustomDocumentIndexDescKey;
*/
@property (assign) BOOL warnOnUndocumentedMember;
+/** Indicates whether appledoc will warn if it encounters an undocumented method parameter
+
+ @see warnOnUndocumentedMember
+ */
+@property (assign) BOOL warnOnUndocumentedParam;
+
/** Indicates whether appledoc will warn if it encounters an empty description (@bug, @warning, example section etc.).
*/
@property (assign) BOOL warnOnEmptyDescription;
@@ -196,7 +196,7 @@ - (void)processParametersFromComment:(GBComment *)comment matchingMethod:(GBMeth
[names enumerateObjectsUsingBlock:^(NSString *name, NSUInteger idx, BOOL *stop) {
GBCommentArgument *parameter = [parameters objectForKey:name];
if (!parameter) {
- if (method.includeInOutput)
+ if (self.settings.warnOnUndocumentedParam && method.includeInOutput)
GBLogXWarn(comment.sourceInfo, @"%@: Description for parameter '%@' missing for %@!", comment.sourceInfo, name, method);
return;
}

0 comments on commit 5f763f2

Please sign in to comment.