diff --git a/infer/bin/BuckAnalyze b/infer/bin/BuckAnalyze index 4bbb0f6f4..828bac0a9 100755 --- a/infer/bin/BuckAnalyze +++ b/infer/bin/BuckAnalyze @@ -67,8 +67,7 @@ def prepare_build(args): infer_options = [ '--buck', '--incremental', - '--analyzer', - args.analyzer, + '--analyzer', args.analyzer, ] if args.debug: diff --git a/infer/bin/inferlib.py b/infer/bin/inferlib.py index 3bb5bf92d..6d9d8a7ec 100644 --- a/infer/bin/inferlib.py +++ b/infer/bin/inferlib.py @@ -115,10 +115,15 @@ inferJ_group.add_argument('--infer_cache', metavar='', help='Select a directory to contain the infer cache') inferJ_group.add_argument('-pr', '--project_root', - dest='project_root', - default=os.getcwd(), - help='Location of the project root ' - '(default is current directory)') + dest='project_root', + default=os.getcwd(), + help='Location of the project root ' + '(default is current directory)') + +inferJ_group.add_argument('--absolute-paths', + action='store_true', + default=False, + help='Report errors with absolute paths') inferJ_group.add_argument('--objc_ml_buckets', dest='objc_ml_buckets', @@ -411,8 +416,8 @@ class Infer: infer_cmd = [utils.get_cmd_in_bin_dir('InferJava')] - if self.args.buck: - infer_cmd += ['-project_root', os.getcwd()] + if not self.args.absolute_paths: + infer_cmd += ['-project_root', self.args.project_root] infer_cmd += [ '-results_dir', self.args.infer_out, diff --git a/infer/tests/codetoanalyze/java/checkers/BUCK b/infer/tests/codetoanalyze/java/checkers/BUCK index 869420dad..b245db692 100644 --- a/infer/tests/codetoanalyze/java/checkers/BUCK +++ b/infer/tests/codetoanalyze/java/checkers/BUCK @@ -18,6 +18,7 @@ clean_cmd = ' '.join(['rm', '-rf', out]) classpath = ':'.join([('$(classpath ' + path + ')') for path in dependencies]) infer_cmd = ' '.join([ 'infer', + '--absolute-paths', '-o', out, '-a', 'checkers', '--', diff --git a/infer/tests/codetoanalyze/java/eradicate/BUCK b/infer/tests/codetoanalyze/java/eradicate/BUCK index 21b1891f9..7867c2fd8 100644 --- a/infer/tests/codetoanalyze/java/eradicate/BUCK +++ b/infer/tests/codetoanalyze/java/eradicate/BUCK @@ -24,6 +24,7 @@ classpath = ':'.join([('$(classpath ' + path + ')') for path in dependencies]) env_cmd = ' '.join(['export', 'ERADICATE_RETURN_OVER_ANNOTATED=1']) infer_cmd = ' '.join([ 'infer', + '--absolute-paths', '-o', out, '-a', 'eradicate', '--', diff --git a/infer/tests/codetoanalyze/java/infer/BUCK b/infer/tests/codetoanalyze/java/infer/BUCK index e3eb9f763..51fd4e7f2 100644 --- a/infer/tests/codetoanalyze/java/infer/BUCK +++ b/infer/tests/codetoanalyze/java/infer/BUCK @@ -23,6 +23,7 @@ def analysis_cmd(analyzer): classpath = ':'.join([('$(classpath ' + path + ')') for path in dependencies]) infer_cmd = ' '.join([ 'infer', + '--absolute-paths', '--no-filtering', '-o', out, '-a', analyzer, diff --git a/infer/tests/codetoanalyze/java/tracing/BUCK b/infer/tests/codetoanalyze/java/tracing/BUCK index f92ba7a2d..0c05a7755 100644 --- a/infer/tests/codetoanalyze/java/tracing/BUCK +++ b/infer/tests/codetoanalyze/java/tracing/BUCK @@ -18,6 +18,7 @@ clean_cmd = ' '.join(['rm', '-rf', out]) classpath = ':'.join([('$(classpath ' + path + ')') for path in dependencies]) infer_cmd = ' '.join([ 'infer', + '--absolute-paths', '-o', out, '-a', 'tracing', '--',