Skip to content

Commit

Permalink
Mark C methods as explicit but also remove explicit check in stats.
Browse files Browse the repository at this point in the history
Given the use of macros and directives to define methods, the explicit
check should not be used to rule out objects in method counts of stats.

Fixes #727
  • Loading branch information
lsegal committed Mar 22, 2014
1 parent c9553ee commit bbb3672
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/yard/cli/stats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def stats_for_constants
# Statistics for methods
def stats_for_methods
objs = all_objects.select {|m| m.type == :method }
objs.reject! {|m| m.is_alias? || !m.is_explicit? }
objs.reject! {|m| m.is_alias? }
undoc = objs.select {|m| m.docstring.blank? }
@undoc_list |= undoc if @undoc_list
output "Methods", objs.size, undoc.size
Expand Down
1 change: 1 addition & 0 deletions lib/yard/handlers/c/handler_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def handle_method(scope, var_name, name, func_name, source_file = nil)
register MethodObject.new(namespace, name, scope) do |obj|
register_visibility(obj, visibility)
find_method_body(obj, func_name)
obj.explicit = true
obj.add_tag(Tags::Tag.new(:return, '', 'Boolean')) if name =~ /\?$/
end
end
Expand Down

0 comments on commit bbb3672

Please sign in to comment.