Method: JsDuck::Warning::Registry#initialize
- Defined in:
- lib/jsduck/warning/registry.rb
#initialize ⇒ Registry
Returns a new instance of Registry.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/jsduck/warning/registry.rb', line 13 def initialize @warnings = [] @warnings_map = {} # Basic warnings [ [:global, "Member doesn't belong to any class"], [:inheritdoc, "@inheritdoc referring to unknown class or member"], [:extend, "@extend/mixin/requires/uses referring to unknown class"], [:tag, "Use of unsupported @tag"], [:tag_repeated, "An @tag used multiple times, but only once allowed"], [:tag_syntax, "@tag syntax error"], [:link, "{@link} to unknown class or member"], [:link_ambiguous, "{@link} is ambiguous"], [:link_auto, "Auto-detected link to unknown class or member"], [:html, "Unclosed HTML tag"], [:alt_name, "Name used as both classname and alternate classname"], [:name_missing, "Member or parameter has no name"], [: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"], [:param_count, "Less parameters documented than detected from code"], [:subproperty, "@param foo.bar where foo param doesn't exist"], [:sing_static, "Singleton class member marked as @static"], [:type_syntax, "Syntax error in {type definition}"], [:type_name, "Unknown type referenced in {type definition}"], [:enum, "Enum with invalid values or no values at all"], [:fires, "@fires references unknown event"], [:image, "{@img} referring to missing file"], [:image_unused, "An image exists in --images dir that's not used"], [:cat_old_format, "Categories file uses old deprecated format"], [:cat_no_match, "Class pattern in categories file matches nothing"], [:cat_class_missing, "Class is missing from categories file"], [:guide, "Guide is missing from --guides dir"], [:aside, "Problem with @aside tag"], [:hide, "Problem with @hide tag"], ].each do |w| register(w[0], Warning::Basic.new(w[0], w[1])) end # :nodoc warning register(:nodoc, Warning::Nodoc.new) # :all warning (encompasses all other warning types) register(:all, Warning::All.new(@warnings.clone)) # :deprecated warnings (linking to :nodoc warning) [ {:type => :no_doc, :msg => "Alias for nodoc(class,public)", :params => [:class, :public]}, {:type => :no_doc_member, :msg => "Alias for nodoc(member,public)", :params => [:member, :public]}, {:type => :no_doc_param, :msg => "Alias for nodoc(param,public)", :params => [:param, :public]}, ].each do |w| register(w[:type], Warning::Deprecated.new(w[:type], w[:msg], @warnings_map[:nodoc], w[:params])) end end |