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 <target-name>
will do it, because the `.*skip_me.*` regex will match the desired rule.

Reviewed By: jvillard

Differential Revision: D2702872

fb-gh-sync-id: 498b17b
master
martinoluca 9 years ago committed by facebook-github-bot-7
parent f7ecf30739
commit e62920ebae

@ -55,6 +55,9 @@ def create_argparser(group_name=MODULE_NAME):
group.add_argument('--xcode-developer-dir', group.add_argument('--xcode-developer-dir',
help='Specify the path to Xcode developer directory ' help='Specify the path to Xcode developer directory '
'(requires --use-flavors to work)') '(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 return parser
@ -105,6 +108,10 @@ class BuckAnalyzer:
args.append('--config') args.append('--config')
args.append('apple.xcode_developer_dir={devdir}'.format( args.append('apple.xcode_developer_dir={devdir}'.format(
devdir=self.args.xcode_developer_dir)) 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 return args
def _get_analysis_result_files(self): def _get_analysis_result_files(self):

Loading…
Cancel
Save