diff --git a/CHANGELOG.md b/CHANGELOG.md index 8443a8bff..a59745f92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,11 @@ [JP Simard](https://github.com/jpsim) [#824](https://github.com/realm/jazzy/issues/824) +* Stop --skip-undocumented from skipping documented items nested + inside extensions of types from other modules. + [John Fairhurst](https://github.com/johnfairh) + [#502](https://github.com/realm/jazzy/issues/502) + ## 0.8.2 ##### Breaking diff --git a/lib/jazzy/sourcekitten.rb b/lib/jazzy/sourcekitten.rb index fad0ab862..43f676d47 100644 --- a/lib/jazzy/sourcekitten.rb +++ b/lib/jazzy/sourcekitten.rb @@ -227,11 +227,6 @@ def self.make_default_doc_info(declaration) declaration.children = [] end - def self.documented_child?(doc) - return false unless doc['key.substructure'] - doc['key.substructure'].any? { |child| documented_child?(child) } - end - def self.availability_attribute?(doc) return false unless doc['key.attributes'] !doc['key.attributes'].select do |attribute| @@ -282,13 +277,13 @@ def self.process_undocumented_token(doc, declaration) objc = Config.instance.objc_mode if objc || should_mark_undocumented(doc['key.kind'], filepath) @stats.add_undocumented(declaration) + return nil if @skip_undocumented declaration.abstract = @undocumented_abstract else comment = doc['key.doc.comment'] declaration.abstract = Markdown.render(comment) if comment end - return nil if !documented_child?(doc) && @skip_undocumented declaration end @@ -389,6 +384,7 @@ def self.make_source_declarations(docs, parent = nil) next unless make_doc_info(doc, declaration) make_substructure(doc, declaration) + next if declaration.type.extension? && declaration.children.empty? declarations << declaration end declarations diff --git a/spec/integration_spec.rb b/spec/integration_spec.rb index a4abf334b..fc66cd138 100644 --- a/spec/integration_spec.rb +++ b/spec/integration_spec.rb @@ -104,6 +104,9 @@ s.default_args = [] s.replace_path ROOT.to_s, 'ROOT' s.replace_pattern /^[\d\s:.-]+ ruby\[\d+:\d+\] warning:.*$[\n]?/, '' + # Remove version numbers from CocoaPods dependencies + # to make specs resilient against dependecy updates. + s.replace_pattern /(Installing \w+ )\((.*)\)/, '\1(X.Y.Z)' end require 'shellwords' diff --git a/spec/integration_specs b/spec/integration_specs index 78fcab344..da50010e6 160000 --- a/spec/integration_specs +++ b/spec/integration_specs @@ -1 +1 @@ -Subproject commit 78fcab344bb4a9c883127e4ece1e42401ec57823 +Subproject commit da50010e66492d8c1adb4b9e73c777e972b8ce95