Commit b5989b0b authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Also print warnings for undocumented parameters.

But for classes only warn about public ones that are undocumented.
parent c32c1bec
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ module JsDuck

        [:alt_name, "Name used as both classname and alternate classname"],
        [:name_missing, "Member or parameter has no name"],
        [:no_doc, "Member or class without documentation"],
        [:no_doc, "Public class or member without documentation"],
        [:dup_param, "Method has two parameters with the same name"],
        [:dup_member, "Class has two members with the same name"],
        [:req_after_opt, "Required parameter comes after optional"],
+17 −5
Original line number Diff line number Diff line
@@ -40,14 +40,26 @@ module JsDuck
      # print warning for each class or public member with no name
      def warn_no_doc
        @relations.each do |cls|
          if cls[:doc] == ""

          if cls[:doc] == "" && !cls[:private]
            warn(:no_doc, "No documentation for #{cls[:name]}", cls)
          end
        end
        each_member do |member|
          if member[:doc] == "" && !member[:private] && !member[:hide] && !JsDuck::Class.constructor?(member)

          cls.all_local_members.each do |member|
            if !member[:private] && !member[:hide] && !JsDuck::Class.constructor?(member)
              if member[:doc] == ""
                warn(:no_doc, "No documentation for #{member[:owner]}##{member[:name]}", member)
              end

              (member[:params] || []).each do |p|
                if p[:doc] == ""
                  warn(:no_doc, "No documentation for parameter #{p[:name]} of #{member[:owner]}##{member[:name]}", member)
                end
              end

            end
          end

        end
      end