|
|
@ -20,8 +20,6 @@ type log_t =
|
|
|
|
exn ->
|
|
|
|
exn ->
|
|
|
|
unit
|
|
|
|
unit
|
|
|
|
|
|
|
|
|
|
|
|
type log_issue = Typ.Procname.t -> log_t
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type log_issue_from_errlog = Errlog.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 =
|
|
|
|
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
|
|
|
|
Errlog.log_issue err_kind err_log loc node_id session ltr ?linters_def_file exn
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let log_issue
|
|
|
|
let log_issue_from_summary err_kind summary ?loc ?node_id ?session ?ltr ?linters_def_file exn =
|
|
|
|
err_kind
|
|
|
|
let should_suppress_lint =
|
|
|
|
proc_name
|
|
|
|
|
|
|
|
?loc
|
|
|
|
|
|
|
|
?node_id
|
|
|
|
|
|
|
|
?session
|
|
|
|
|
|
|
|
?ltr
|
|
|
|
|
|
|
|
?linters_def_file
|
|
|
|
|
|
|
|
exn =
|
|
|
|
|
|
|
|
let should_suppress_lint (summary : Specs.summary) =
|
|
|
|
|
|
|
|
Config.curr_language_is Config.Java &&
|
|
|
|
Config.curr_language_is Config.Java &&
|
|
|
|
Annotations.ia_is_suppress_lint (fst summary.attributes.ProcAttributes.method_annotation) in
|
|
|
|
Annotations.ia_is_suppress_lint
|
|
|
|
match Specs.get_summary proc_name with
|
|
|
|
(fst summary.Specs.attributes.ProcAttributes.method_annotation) in
|
|
|
|
| Some summary when should_suppress_lint summary -> ()
|
|
|
|
if not should_suppress_lint
|
|
|
|
| Some summary ->
|
|
|
|
then
|
|
|
|
let err_log = summary.Specs.attributes.ProcAttributes.err_log in
|
|
|
|
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_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 ->
|
|
|
|
|
|
|
|
log_issue_from_summary err_kind summary ?loc ?node_id ?session ?ltr ?linters_def_file exn
|
|
|
|
| None ->
|
|
|
|
| None ->
|
|
|
|
failwithf
|
|
|
|
failwithf
|
|
|
|
"Trying to report error on procedure %a, but cannot because no summary exists for this \
|
|
|
|
"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
|
|
|
|
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_error_from_errlog = log_issue_from_errlog Exceptions.Kerror
|
|
|
|
let log_warning_from_errlog = log_issue_from_errlog Exceptions.Kwarning
|
|
|
|
let log_warning_from_errlog = log_issue_from_errlog Exceptions.Kwarning
|
|
|
|
let log_info_from_errlog = log_issue_from_errlog Exceptions.Kinfo
|
|
|
|
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
|
|
|
|