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

Turn :link_auto warnings off by default.

parent b5e84367
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -38,11 +38,12 @@ module JsDuck
        [:cat_class_missing, "Class is missing from categories file"],
        [:guide, "Guide is missing from --guides dir"],
      ]
      # Turn on all warnings by default
      # Turn on all warnings except :link_auto
      @warnings = {}
      @warning_docs.each do |w|
        @warnings[w[0]] = true
      end
      set_warning(:link_auto, false)

      @shown_warnings = {}
    end
@@ -70,11 +71,7 @@ module JsDuck

    # get documentation for all warnings
    def doc_warnings
      @warning_docs.map {|w| "+#{w[0]} - #{w[1]}" } + [
        " ",
        "+all - to turn on all warnings (default)",
        " ",
      ]
      @warning_docs.map {|w| " #{@warnings[w[0]] ? '+' : '-'}#{w[0]} - #{w[1]}" } + [" "]
    end

    # Prints warning message.
+4 −2
Original line number Diff line number Diff line
@@ -275,8 +275,10 @@ module JsDuck

        opts.on('--warnings=+A,-B,+C', Array,
          "Turns warnings selectively on/off.",
          "+foo turns on a warning, -foo turns it off.",
          "Possible warning types are:",
          " ",
          " +all - to turn on all warnings",
          " ",
          "By default these warnings are turned +on/-off:",
          " ",
          *Logger.instance.doc_warnings) do |warnings|
          warnings.each do |op|