reviewbot.tools.fbinfer¶
Review Bot tool to run FBInfer.
Classes
|
Review Bot tool to run FBInfer. |
- class FBInferTool(settings=None, **kwargs)[source]¶
Bases:
FullRepositoryToolMixin
,BaseTool
Review Bot tool to run FBInfer.
- version = '1.0'[source]¶
The compatibility version of the tool.
This should only be changed for major breaking updates. It will break compatibility with existing integration configurations, requiring manual updates to those configurations. Any existing configurations referencing the old version will not be run, unless an older version of the tool is being handled through another Review Bot worker providing the older tool.
- Type:
unicode
- description = 'Checks code for errors using FBInfer, a tool for static Android, Java, C, C++, and iOS/Objective-C code analysis.'[source]¶
A short description of the tool.
- Type:
unicode
- exe_dependencies = ['infer'][source]¶
A list of executable tools required by the tool.
Each is the name of an executable on the filesystem, either in the
PATH
or defined in theexe_paths
configuration.These will be checked when the worker starts. If a dependency for a tool is missing, the worker will not enable it.
New in version 3.0: Tools that previously implemented
check_dependencies()
may want to be updated to use this.- Type:
dict
- options = [{'name': 'build_type', 'field_type': 'django.forms.ChoiceField', 'field_options': {'label': 'Build system', 'help_text': 'Choose how the project will be compiled.', 'choices': (('./gradlew', 'Android/Gradle with Wrapper (./gradlew)'), ('ant', 'Apache Ant (ant)'), ('buck build', 'Buck (buck build)'), ('clang -c', 'Clang (clang -c)'), ('cmake', 'CMake (cmake)'), ('gradle', 'Gradle (gradle)'), ('javac', 'Java (javac)'), ('make', 'Make (make)'), ('mvn', 'Maven (mvn)'), ('xcodebuild', 'XCode (xcodebuild)'))}}, {'name': 'build_target', 'field_type': 'django.forms.CharField', 'default': '', 'field_options': {'label': 'Build target', 'required': False, 'help_text': 'The name of the target to build, if the build system needs one or is capable of building multiple targets.'}}, {'name': 'xcode_configuration', 'field_type': 'django.forms.CharField', 'default': '', 'field_options': {'label': 'XCode configuration', 'required': False, 'help_text': 'Any additional configuration options needed for a XCode build (equivalent to the -configuration flag). This is ignored for non-XCode builds'}}, {'name': 'sdk', 'field_type': 'django.forms.CharField', 'default': '', 'field_options': {'label': 'XCode SDK', 'required': False, 'help_text': 'Include an XCode SDK required to build a project such as "iphonesimulator" for iOS. This is ignored for non-XCode builds.'}}][source]¶
Configurable options defined for the tool.
Each item in the list is a dictionary representing a form field to display in the Review Board administration UI. Keys include:
field_type
(unicode
):The full path as a string to a Django form field class to render.
name
(unicode
):The name/ID of the field. This will map to the key in the settings provided to
handle_files()
andhandle_file()
.default
(object
, optional):The default value for the field.
field_options
(dict
, optional):Additional options to pass to the form field’s constructor.
widget
(dict
, optional):Information on the Django form field widget class used to render the field. This dictionary includes the following keys:
type
(unicode
):The full path as a string to a Django form field widget class.
attrs
(dict
, optional):A dictionary of attributes passed to the widget’s constructor.
- Type:
list
- MULTI_FILE_BUILD_TYPES = {'./gradlew', 'ant', 'buck build', 'cmake', 'gradle', 'make', 'mvn', 'xcodebuild'}[source]¶
- build_base_command(**kwargs)[source]¶
Build the base command line used to review files.
- Parameters:
**kwargs (
dict
, unused) – Additional keyword arguments.- Returns:
The base command line.
- Return type:
list
ofunicode
- handle_files(files, review, base_command, **kwargs)[source]¶
Perform a review of all files.
- Parameters:
files (
list
ofreviewbot.processing.review.File
) – The files to process.review (
reviewbot.processing.review.Review
) – The review being populated.base_command (
list
ofunicode
) – The base command used to run infer.**kwargs (
dict
) – Additional keyword arguments.
- handle_file(f, path, review, base_command, report, **kwargs)[source]¶
Perform a review of a single file.
If this is part of a multi-file build, the results for this file from that build will be reported. If not a multi-file build, then infer will be run on this file before reporting results.
- Parameters:
f (
reviewbot.processing.review.File
) – The file to process.path (
unicode
) – The local path to the patched file to review.review (
reviewbot.processing.review.Review
) – The review being populated.base_command (
list
ofunicode
) – The base command used to run infer.report (
list
ofdict
) – The report to append to.**kwargs (
dict
, unused) – Additional keyword arguments.
- __annotations__ = {}¶