Reviewed By: sblackshear Differential Revision: D3561522 fbshipit-source-id: f42ba93master
parent
e8fd648fe8
commit
1617d470f1
@ -0,0 +1,44 @@
|
|||||||
|
(*
|
||||||
|
* Copyright (c) 2016 - present Facebook, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the BSD style license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
*)
|
||||||
|
|
||||||
|
type issue =
|
||||||
|
| Assign_pointer_warning
|
||||||
|
| Strong_delegate_warning
|
||||||
|
| Global_variable_initialized_with_function_or_method_call
|
||||||
|
| Direct_atomic_property_access
|
||||||
|
| Cxx_reference_captured_in_objc_block
|
||||||
|
| Registered_observer_being_deallocated
|
||||||
|
|
||||||
|
let to_string issue =
|
||||||
|
match issue with
|
||||||
|
| Assign_pointer_warning -> "ASSIGN_POINTER_WARNING"
|
||||||
|
| Strong_delegate_warning -> "STRONG_DELEGATE_WARNING"
|
||||||
|
| Global_variable_initialized_with_function_or_method_call ->
|
||||||
|
"GLOBAL_VARIABLE_INITIALIZED_WITH_FUNCTION_OR_METHOD_CALL"
|
||||||
|
| Direct_atomic_property_access -> "DIRECT_ATOMIC_PROPERTY_ACCESS"
|
||||||
|
| Cxx_reference_captured_in_objc_block -> "CXX_REFERENCE_CAPTURED_IN_OBJC_BLOCK"
|
||||||
|
| Registered_observer_being_deallocated ->
|
||||||
|
Localise.to_string (Localise.registered_observer_being_deallocated)
|
||||||
|
|
||||||
|
let severity_of_issue issue =
|
||||||
|
match issue with
|
||||||
|
| Assign_pointer_warning
|
||||||
|
| Strong_delegate_warning
|
||||||
|
| Global_variable_initialized_with_function_or_method_call
|
||||||
|
| Direct_atomic_property_access
|
||||||
|
| Cxx_reference_captured_in_objc_block
|
||||||
|
| Registered_observer_being_deallocated -> Exceptions.Kwarning
|
||||||
|
|
||||||
|
|
||||||
|
type issue_desc = {
|
||||||
|
issue : issue; (* issue *)
|
||||||
|
description : string; (* Description in the error message *)
|
||||||
|
suggestion : string option; (* an optional suggestion or correction *)
|
||||||
|
loc : Location.t; (* location in the code *)
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
(*
|
||||||
|
* Copyright (c) 2016 - present Facebook, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the BSD style license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
*)
|
||||||
|
|
||||||
|
type issue =
|
||||||
|
| Assign_pointer_warning
|
||||||
|
| Strong_delegate_warning
|
||||||
|
| Global_variable_initialized_with_function_or_method_call
|
||||||
|
| Direct_atomic_property_access
|
||||||
|
| Cxx_reference_captured_in_objc_block
|
||||||
|
| Registered_observer_being_deallocated
|
||||||
|
|
||||||
|
val to_string : issue -> string
|
||||||
|
|
||||||
|
val severity_of_issue : issue -> Exceptions.err_kind
|
||||||
|
|
||||||
|
type issue_desc = {
|
||||||
|
issue : issue; (* issue *)
|
||||||
|
description : string; (* Description in the error message *)
|
||||||
|
suggestion : string option; (* an optional suggestion or correction *)
|
||||||
|
loc : Location.t; (* location in the code *)
|
||||||
|
}
|
Loading…
Reference in new issue