Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add the ability to suppress warnings for undocumented parameters #273

Merged
merged 1 commit into from

2 participants

@sirwart

I wasn't quite sure what --warn-missing-arg was supposed to do, but from the code it looks like it controls warning when you've documented a parameter that doesn't exist, but let me know if there's a better way to fix this.

@tomaz
Owner

It's been a while since I was working on this, so not sure :) Also not behind computer right now so can't check

Thanks for fix though, merging it right now.

@tomaz tomaz merged commit 5f763f2 into tomaz:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 25, 2012
This page is out of date. Refresh to see the latest.
View
4 Application/GBAppledocApplication.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");
View
6 Application/GBApplicationSettingsProvider.h
@@ -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;
View
2  Processing/GBProcessor.m
@@ -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;
}
Something went wrong with that request. Please try again.