[infer][toplevel] remove dead code from the python bucklib.py scripts

Reviewed By: jvillard

Differential Revision: D4431686

fbshipit-source-id: 0ddfcf9
master
Jeremy Dubreil 8 years ago committed by Facebook Github Bot
parent d39d4cfa20
commit d9ed75cc08

@ -184,5 +184,6 @@ def main():
global_argparser.print_help()
sys.exit(os.EX_OK)
if __name__ == '__main__':
main()

@ -12,16 +12,11 @@ from __future__ import unicode_literals
import argparse
import csv
import json
import logging
import multiprocessing
import os
import shutil
import subprocess
import sys
import time
from . import config, issues, utils
from . import config, utils
# Increase the limit of the CSV parser to sys.maxlimit
csv.field_size_limit(sys.maxsize)

@ -13,20 +13,15 @@ from __future__ import print_function
from __future__ import unicode_literals
import argparse
import csv
import json
import logging
import multiprocessing
import os
import platform
import re
import shutil
import stat
import subprocess
import sys
import tempfile
import time
import traceback
import zipfile
from inferlib import config, issues, utils
@ -55,10 +50,7 @@ def prepare_build(args):
configuration that tells buck to use that script.
"""
infer_options = [
'--buck',
'--analyzer', args.analyzer,
]
infer_options = ['--buck']
if args.java_jar_compiler is not None:
infer_options += [
@ -66,15 +58,6 @@ def prepare_build(args):
args.java_jar_compiler,
]
if args.debug:
infer_options.append('--debug')
if args.no_filtering:
infer_options.append('--no-filtering')
if args.debug_exceptions:
infer_options += ['--debug-exceptions', '--no-filtering']
# Create a temporary directory as a cache for jar files.
infer_cache_dir = os.path.join(args.infer_out, 'cache')
if not os.path.isdir(infer_cache_dir):
@ -92,10 +75,6 @@ def prepare_build(args):
logging.info('Setup Infer analysis mode for Buck: export INFER_ANALYSIS=1')
os.environ['INFER_ANALYSIS'] = '1'
# Export the Infer command as environment variables
os.environ['INFER_JAVA_BUCK_OPTIONS'] = json.dumps(infer_command)
os.environ['INFER_RULE_KEY'] = utils.infer_key(args.analyzer)
# Create a script to be called by buck
infer_script = None
with tempfile.NamedTemporaryFile(delete=False,
@ -164,13 +143,6 @@ def collect_results(args, start_time, targets):
"""
all_json_rows = set()
accumulation_whitelist = list(map(re.compile, [
'^cores$',
'^time$',
'^start_time$',
'.*_pc',
]))
for path in get_output_jars(targets):
try:
with zipfile.ZipFile(path) as jar:
@ -194,7 +166,8 @@ def collect_results(args, start_time, targets):
bugs_out = os.path.join(args.infer_out, config.BUGS_FILENAME)
issues.print_and_save_errors(args.infer_out, args.project_root,
json_report, bugs_out, args.pmd_xml)
shutil.copy(bugs_out, os.path.join(args.infer_out, ANALYSIS_SUMMARY_OUTPUT))
shutil.copy(bugs_out, os.path.join(args.infer_out,
ANALYSIS_SUMMARY_OUTPUT))
def cleanup(temp_files):

@ -22,6 +22,7 @@ LANG = ['java']
def gen_instance(*args):
return AntCapture(*args)
# This creates an empty argparser for the module, which provides only
# description/usage information and no arguments.
create_argparser = util.base_argparser(MODULE_DESCRIPTION, MODULE_NAME)

@ -25,6 +25,7 @@ LANG = ['java']
def gen_instance(*args):
return GradleCapture(*args)
# This creates an empty argparser for the module, which provides only
# description/usage information and no arguments.
create_argparser = util.base_argparser(MODULE_DESCRIPTION, MODULE_NAME)

@ -24,6 +24,7 @@ LANG = ['java']
def gen_instance(*args):
return MavenCapture(*args)
# This creates an empty argparser for the module, which provides only
# description/usage information and no arguments.
create_argparser = util.base_argparser(MODULE_DESCRIPTION, MODULE_NAME)

@ -31,6 +31,7 @@ CLANGPLUSPLUS_WRAPPER = os.path.join(config.XCODE_WRAPPERS_DIRECTORY,
def gen_instance(*args):
return XcodebuildCapture(*args)
create_argparser = util.base_argparser(MODULE_DESCRIPTION, MODULE_NAME)

@ -149,7 +149,6 @@ def _text_of_report_list(project_root, reports, bugs_txt_path, limit=None,
'see %s or run `inferTraceBugs` for the remaining issues.')
% (limit, bugs_txt_path), colorize.HEADER, formatter)
issues_found = 'Found {n_issues}'.format(
n_issues=utils.get_plural('issue', n_issues),
)

@ -11,7 +11,6 @@ from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
import subprocess
from . import config

@ -83,7 +83,6 @@ def build_source_context(source_name, mode, report_line):
line_number += 1
excerpt = colorize.syntax_highlighting(source_name, mode, excerpt)
# number lines and add caret at the right position
n_length = len(str(last_line))
s = ''

@ -42,5 +42,6 @@ def main():
issues.print_and_save_errors(args.results_dir, args.project_root,
args.issues_json, bugs_out, args.pmd_xml)
if __name__ == '__main__':
main()

Loading…
Cancel
Save