From e62920ebae7e005927b8b68b4fff98807f537f20 Mon Sep 17 00:00:00 2001 From: martinoluca Date: Mon, 30 Nov 2015 09:36:26 -0800 Subject: [PATCH] Add support for passing blacklist regex for files to not analyze with Buck Summary: public With this change it will be possible to instruct Buck to not analyze certain files whose names match with the regex passed in input. So for example if you want to skip the analysis of files containing `skip_me` on their names, then the command: infer --use-flavors --blacklist-regex ".*skip_me.*" -- buck build will do it, because the `.*skip_me.*` regex will match the desired rule. Reviewed By: jvillard Differential Revision: D2702872 fb-gh-sync-id: 498b17b --- infer/lib/python/inferlib/capture/buck.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/infer/lib/python/inferlib/capture/buck.py b/infer/lib/python/inferlib/capture/buck.py index e711fe3bf..6b8153886 100644 --- a/infer/lib/python/inferlib/capture/buck.py +++ b/infer/lib/python/inferlib/capture/buck.py @@ -55,6 +55,9 @@ def create_argparser(group_name=MODULE_NAME): group.add_argument('--xcode-developer-dir', help='Specify the path to Xcode developer directory ' '(requires --use-flavors to work)') + group.add_argument('--blacklist-regex', + help='Specify the regex for files to skip during ' + 'the analysis (requires --use-flavors to work)') return parser @@ -105,6 +108,10 @@ class BuckAnalyzer: args.append('--config') args.append('apple.xcode_developer_dir={devdir}'.format( devdir=self.args.xcode_developer_dir)) + if self.args.blacklist_regex: + args.append('--config') + args.append('infer.blacklist_regex={regex}'.format( + regex=self.args.blacklist_regex)) return args def _get_analysis_result_files(self):