Sha256: cde3cedc7f0473efe3c8122e8f107e8c3b80c3907104475086796ebe776cc83e
Contents?: true
Size: 1.23 KB
Versions: 16
Compression:
Stored size: 1.23 KB
Contents
require 'jsduck/logger' require 'jsduck/class' module JsDuck module Process # Reports missing documentation class NoDoc def initialize(relations) @relations = relations end # Prints warning for each class or public member with no name def process_all! @relations.each do |cls| if cls[:doc] == "" warn(:class, "No documentation for #{cls[:name]}", cls) end cls.all_local_members.each do |member| if !member[:hide] && !JsDuck::Class.constructor?(member) if member[:doc] == "" warn(:member, "No documentation for #{member[:owner]}##{member[:name]}", member) end (member[:params] || []).each do |p| if p[:doc] == "" warn(:param, "No documentation for parameter #{p[:name]} of #{member[:owner]}##{member[:name]}", member) end end end end end end private def warn(type, msg, owner) visibility = owner[:private] ? :private : (owner[:protected] ? :protected : :public) Logger.warn(:nodoc, msg, owner[:files][0], [type, visibility]) end end end end
Version data entries
16 entries across 16 versions & 3 rubygems