basho / cuttlefish

never lose your childlike sense of wonder baby cuttlefish, promise me?
Apache License 2.0
205 stars 124 forks source link

Fix dialyzer warnings #26

Closed seancribbs closed 11 years ago

seancribbs commented 11 years ago
conf_parse.erl:211: The created fun has no local return
conf_parse.erl:212: Fun application will fail since P :: none() is not a function of arity 2
conf_parse.erl:283: Guard test is_list(S::<<_:8,_:_*8>>) can never succeed
conf_parse.erl:315: The created fun has no local return
cuttlefish_conf.erl:62: Function generate_file/2 has no local return
cuttlefish_conf.erl:65: The call file:open(Filename::any(),'write') breaks the contract (File,Modes) -> {'ok',IoDevice} | {'error',Reason} when is_subtype(File,Filename | iodata()), is_subtype(Filename,name_all()), is_subtype(Modes,[mode() | 'ram']), is_subtype(IoDevice,io_device()), is_subtype(Reason,posix() | 'badarg' | 'system_limit')
cuttlefish_generator.erl:48: The call cuttlefish_validator:func(V::'false' | tuple()) does not have an opaque term of type cuttlefish_validator:validator() as 1st argument
cuttlefish_generator.erl:137: Function set_value/3 has no local return
cuttlefish_generator.erl:138: The call cuttlefish_util:replace_proplist_value(atom(),NewValue::any(),Acc::any()) breaks the contract (string(),any(),[{string(),any()}]) -> [{string(),any()}]
cuttlefish_generator.erl:236: The pattern [{_, Var} | _] can never match the type [string()]
cuttlefish_generator.erl:278: The pattern 'undefined' can never match the type string()
cuttlefish_mapping.erl:94: Invalid type specification for function cuttlefish_mapping:variable/1. The success typing is (cuttlefish_mapping:mapping()) -> 'undefined' | [string()]
cuttlefish_mapping.erl:121: Invalid type specification for function cuttlefish_mapping:validators/2. The success typing is (cuttlefish_mapping:mapping(),_) -> ['false' | tuple()]
cuttlefish_schema.erl:66: The variable _ can never match since previous clauses completely covered the type {'error',[{_,_}]} | {[cuttlefish_translation:translation()],[cuttlefish_mapping:mapping()],[cuttlefish_validator:validator()]}
cuttlefish_schema.erl:125: The attempt to match a term of type cuttlefish_mapping:mapping() | cuttlefish_translation:translation() against the pattern {'error', Desc} breaks the opaqueness of the term
cuttlefish_schema.erl:175: The pattern {'validator', Return} can never match the type {'mapping',tuple()}
Unknown functions:
  getopt:parse/2
  getopt:usage/2
  lager:do_log/9
  lager:md/0
  lager_config:get/2
  lager_msg:new/4
  lager_util:config_to_mask/1
  lager_util:is_loggable/3
  lager_util:level_to_num/1
  rebar_rel_utils:get_target_dir/2
  rebar_rel_utils:load_config/2
 done in 0m2.46s
done (warnings were emitted)

Based on 08915a789acf0aa0d7b8b7c1dd5cecacad73de76

joedevivo commented 11 years ago

See PR #25 for comments on this as well

joedevivo commented 11 years ago

This is fixed now, PR #27