|
|
|
@ -20,8 +20,6 @@ type log_t =
|
|
|
|
|
exn ->
|
|
|
|
|
unit
|
|
|
|
|
|
|
|
|
|
type log_issue = Typ.Procname.t -> log_t
|
|
|
|
|
|
|
|
|
|
type log_issue_from_errlog = Errlog.t -> log_t
|
|
|
|
|
|
|
|
|
|
let log_issue_from_errlog err_kind err_log ?loc ?node_id ?session ?ltr ?linters_def_file exn =
|
|
|
|
@ -45,23 +43,20 @@ let log_issue_from_errlog err_kind err_log ?loc ?node_id ?session ?ltr ?linters_
|
|
|
|
|
Errlog.log_issue err_kind err_log loc node_id session ltr ?linters_def_file exn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let log_issue
|
|
|
|
|
err_kind
|
|
|
|
|
proc_name
|
|
|
|
|
?loc
|
|
|
|
|
?node_id
|
|
|
|
|
?session
|
|
|
|
|
?ltr
|
|
|
|
|
?linters_def_file
|
|
|
|
|
exn =
|
|
|
|
|
let should_suppress_lint (summary : Specs.summary) =
|
|
|
|
|
let log_issue_from_summary err_kind summary ?loc ?node_id ?session ?ltr ?linters_def_file exn =
|
|
|
|
|
let should_suppress_lint =
|
|
|
|
|
Config.curr_language_is Config.Java &&
|
|
|
|
|
Annotations.ia_is_suppress_lint (fst summary.attributes.ProcAttributes.method_annotation) in
|
|
|
|
|
Annotations.ia_is_suppress_lint
|
|
|
|
|
(fst summary.Specs.attributes.ProcAttributes.method_annotation) in
|
|
|
|
|
if not should_suppress_lint
|
|
|
|
|
then
|
|
|
|
|
let err_log = summary.Specs.attributes.ProcAttributes.err_log in
|
|
|
|
|
log_issue_from_errlog err_kind err_log ?loc ?node_id ?session ?ltr ?linters_def_file exn
|
|
|
|
|
|
|
|
|
|
let log_issue err_kind proc_name ?loc ?node_id ?session ?ltr ?linters_def_file exn =
|
|
|
|
|
match Specs.get_summary proc_name with
|
|
|
|
|
| Some summary when should_suppress_lint summary -> ()
|
|
|
|
|
| Some summary ->
|
|
|
|
|
let err_log = summary.Specs.attributes.ProcAttributes.err_log in
|
|
|
|
|
log_issue_from_errlog err_kind err_log ?loc ?node_id ?session ?ltr ?linters_def_file exn
|
|
|
|
|
log_issue_from_summary err_kind summary ?loc ?node_id ?session ?ltr ?linters_def_file exn
|
|
|
|
|
| None ->
|
|
|
|
|
failwithf
|
|
|
|
|
"Trying to report error on procedure %a, but cannot because no summary exists for this \
|
|
|
|
@ -69,10 +64,14 @@ let log_issue
|
|
|
|
|
Typ.Procname.pp proc_name
|
|
|
|
|
Typ.Procname.pp proc_name
|
|
|
|
|
|
|
|
|
|
let log_error = log_issue Exceptions.Kerror
|
|
|
|
|
let log_warning = log_issue Exceptions.Kwarning
|
|
|
|
|
let log_info = log_issue Exceptions.Kinfo
|
|
|
|
|
|
|
|
|
|
let log_error_from_errlog = log_issue_from_errlog Exceptions.Kerror
|
|
|
|
|
let log_warning_from_errlog = log_issue_from_errlog Exceptions.Kwarning
|
|
|
|
|
let log_info_from_errlog = log_issue_from_errlog Exceptions.Kinfo
|
|
|
|
|
|
|
|
|
|
let log_error_from_summary = log_issue_from_summary Exceptions.Kerror
|
|
|
|
|
let log_warning_from_summary = log_issue_from_summary Exceptions.Kwarning
|
|
|
|
|
let log_info_from_summary = log_issue_from_summary Exceptions.Kwarning
|
|
|
|
|
|
|
|
|
|
let log_error = log_issue Exceptions.Kerror
|
|
|
|
|
let log_warning = log_issue Exceptions.Kwarning
|
|
|
|
|
let log_info = log_issue Exceptions.Kinfo
|
|
|
|
|