From 7b028a2819eb07805382c4e26ba1c87f67777f24 Mon Sep 17 00:00:00 2001 From: iska Date: Fri, 13 Oct 2017 22:47:53 +0200 Subject: [PATCH] Enable warnings for documentation comments and fix present errors --- HTMLKit.xcodeproj/project.pbxproj | 8 ++++++++ Sources/include/CSSPseudoFunctionSelector.h | 2 +- Sources/include/CSSSelector.h | 2 +- Sources/include/CSSSelectors.h | 2 +- Sources/include/HTMLCommentToken.h | 2 +- Sources/include/HTMLElement.h | 10 +++++----- Sources/include/HTMLInputStreamReader.h | 3 ++- Sources/include/HTMLNode.h | 4 ++-- Sources/include/HTMLRange.h | 8 ++++---- Sources/include/HTMLStackOfOpenElements.h | 2 +- Sources/include/HTMLTreeWalker.h | 1 - 11 files changed, 26 insertions(+), 18 deletions(-) diff --git a/HTMLKit.xcodeproj/project.pbxproj b/HTMLKit.xcodeproj/project.pbxproj index 723b0a5..3c66070 100644 --- a/HTMLKit.xcodeproj/project.pbxproj +++ b/HTMLKit.xcodeproj/project.pbxproj @@ -2118,6 +2118,7 @@ 625A14D519C7829400AD0C32 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -2143,6 +2144,7 @@ 625A14D619C7829400AD0C32 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -2218,6 +2220,7 @@ buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; CLANG_ANALYZER_NONNULL = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_UNREACHABLE_CODE = YES; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; @@ -2253,6 +2256,7 @@ buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; CLANG_ANALYZER_NONNULL = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_UNREACHABLE_CODE = YES; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; COPY_PHASE_STRIP = NO; @@ -2288,6 +2292,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=*]" = "iPhone Developer"; @@ -2323,6 +2328,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=*]" = "iPhone Developer"; @@ -2399,6 +2405,7 @@ 62ECBF5F1C0B6C7600AF847B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -2435,6 +2442,7 @@ 62ECBF601C0B6C7600AF847B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; diff --git a/Sources/include/CSSPseudoFunctionSelector.h b/Sources/include/CSSPseudoFunctionSelector.h index f995d5c..9bd36d2 100644 --- a/Sources/include/CSSPseudoFunctionSelector.h +++ b/Sources/include/CSSPseudoFunctionSelector.h @@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN /** Initializes and returns a CSS has-descendant selector, e.g. 'div:has(p)' - @discussion 'div:has(p)' matches all
elements which have a descendant

element. + @discussion 'div:has(p)' matches all <div> elements which have a descendant <p> element. @param selector The selector matching a descendant element. @return A new instance of the has-descendant selector. diff --git a/Sources/include/CSSSelector.h b/Sources/include/CSSSelector.h index 9fd8007..474b8a3 100644 --- a/Sources/include/CSSSelector.h +++ b/Sources/include/CSSSelector.h @@ -76,7 +76,7 @@ extern NSString * _Nonnull NSStringFromNthExpression(CSSNthExpression expression @param string The selector string which will be parsed. @return A new instance of a parsed CSS Selector, `nil` if the string is not a valid selector string. */ -+ (nullable instancetype)selectorWithString:(NSString *)stirng; ++ (nullable instancetype)selectorWithString:(NSString *)string; /** Implementations should override this method to provide the selector-sprecific logic for matching elements. diff --git a/Sources/include/CSSSelectors.h b/Sources/include/CSSSelectors.h index bd8acd9..c6e8a1f 100644 --- a/Sources/include/CSSSelectors.h +++ b/Sources/include/CSSSelectors.h @@ -225,7 +225,7 @@ extern CSSSelector * not(CSSSelector *selector); /** CSS has-descendant selector, e.g. 'div:has(p)' - @discussion 'div:has(p)' matches all

elements which have a descendant

element. + @discussion 'div:has(p)' matches all <div> elements which have a descendant <p> element. @param selector The selector matching a descendant element. @return A has-descendant selector. diff --git a/Sources/include/HTMLCommentToken.h b/Sources/include/HTMLCommentToken.h index a42172a..5c43f1e 100644 --- a/Sources/include/HTMLCommentToken.h +++ b/Sources/include/HTMLCommentToken.h @@ -24,7 +24,7 @@ /** Initializes a new comment token. - @param string The string with which to initialize the token. + @param data The string with which to initialize the token. @return A new instance of a comment token. */ - (instancetype)initWithData:(NSString *)data; diff --git a/Sources/include/HTMLElement.h b/Sources/include/HTMLElement.h index 524921a..2d0b3f5 100644 --- a/Sources/include/HTMLElement.h +++ b/Sources/include/HTMLElement.h @@ -63,7 +63,7 @@ NS_ASSUME_NONNULL_BEGIN /** Initializes a new HTML element with the given tag name. - @param tagname The tag name. + @param tagName The tag name. @return A new HTML element. */ - (instancetype)initWithTagName:(NSString *)tagName; @@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN /** Initializes a new HTML element with the given tag name and attributes. - @param tagname The tag name. + @param tagName The tag name. @param attributes The attributes. @return A new HTML element. */ @@ -80,8 +80,8 @@ NS_ASSUME_NONNULL_BEGIN /** Initializes a new HTML element with the given tag name, namespace, and attributes. - @param tagname The tag name. - @param namespace The namespace. + @param tagName The tag name. + @param htmlNamespace The HTML namespace. @param attributes The attributes. @return A new HTML element. */ @@ -107,7 +107,7 @@ NS_ASSUME_NONNULL_BEGIN Set the value of the attribute with the given name. @param value The value to set. - @param name The attribute's name. + @param attribute The attribute's name. */ - (void)setObject:(NSString *)value forKeyedSubscript:(NSString *)attribute; diff --git a/Sources/include/HTMLInputStreamReader.h b/Sources/include/HTMLInputStreamReader.h index 01d3a6f..d018e00 100644 --- a/Sources/include/HTMLInputStreamReader.h +++ b/Sources/include/HTMLInputStreamReader.h @@ -15,7 +15,8 @@ /** Typedef for the error callback block. - @param reason The string describing the reason of the reported error. + @param code The standarized error-code + @param details The string describing the reason of the reported error. */ typedef void (^ HTMLStreamReaderErrorCallback)(NSString *code, NSString *details); diff --git a/Sources/include/HTMLNode.h b/Sources/include/HTMLNode.h index c9ca332..2631fa7 100644 --- a/Sources/include/HTMLNode.h +++ b/Sources/include/HTMLNode.h @@ -232,7 +232,7 @@ typedef NS_OPTIONS(unsigned short, HTMLDocumentPosition) /** Returns the index of the given child element in the set of child nodes. - @param node The element. + @param element The element. @return The index of the given element in the children set. */ - (NSUInteger)indexOfChildElement:(HTMLElement *)element; @@ -248,7 +248,7 @@ typedef NS_OPTIONS(unsigned short, HTMLDocumentPosition) /** Prepends the given array of nodes to the set of child nodes. - @param node The nodes to prepend. + @param nodes The nodes to prepend. */ - (void)prependNodes:(NSArray *)nodes; diff --git a/Sources/include/HTMLRange.h b/Sources/include/HTMLRange.h index 282f3bc..3cc4950 100644 --- a/Sources/include/HTMLRange.h +++ b/Sources/include/HTMLRange.h @@ -113,16 +113,16 @@ typedef NS_ENUM(unsigned short, HTMLRangeComparisonMethod) /** Sets the start boundary. - @param startNode The new node of the start boundary. - @param startOffset The new offset of the start boundary. + @param node The new node of the start boundary. + @param offset The new offset of the start boundary. */ - (void)setStartNode:(HTMLNode *)node startOffset:(NSUInteger)offset; /** Sets the end boundary. - @param startNode The new node of the end boundary. - @param startOffset The new offset of the end boundary. + @param node The new node of the end boundary. + @param offset The new offset of the end boundary. */ - (void)setEndNode:(HTMLNode *)node endOffset:(NSUInteger)offset; diff --git a/Sources/include/HTMLStackOfOpenElements.h b/Sources/include/HTMLStackOfOpenElements.h index a7f0e0e..d379841 100644 --- a/Sources/include/HTMLStackOfOpenElements.h +++ b/Sources/include/HTMLStackOfOpenElements.h @@ -79,7 +79,7 @@ /** Checks whether an element with the given tag name is in the stack. - @param tagname The element's tag name. + @param tagName The element's tag name. @return `YES` if such an element is in the stack, `NO` otherwise. */ - (BOOL)containsElementWithTagName:(NSString *)tagName; diff --git a/Sources/include/HTMLTreeWalker.h b/Sources/include/HTMLTreeWalker.h index 3b9282a..2faaca1 100644 --- a/Sources/include/HTMLTreeWalker.h +++ b/Sources/include/HTMLTreeWalker.h @@ -49,7 +49,6 @@ NS_ASSUME_NONNULL_BEGIN Initializes a new tree walker with no filter and HTMLNodeFilterShowAll show options. @param node The root node. - @param filter The node filter to use. @return A new instance of a tree walker. */ - (instancetype)initWithNode:(HTMLNode *)node;