예제 #1
0
 def setUp(self) -> None:
     self.all_rules = []  # type: List[Dict[str, Any]]
     with patch('tools.linter_lib.custom_check.custom_check_file', return_value=False) as mock_custom_check_file:
         by_lang = dict.fromkeys(['py', 'js', 'sh', 'scss', 'handlebars', 'html',
                                  'json', 'md', 'txt', 'text', 'yaml', 'rst'],
                                 ['foo/bar.baz'])
         check_custom_checks_py, check_custom_checks_nonpy = build_custom_checkers(by_lang)
         check_custom_checks_py()
         check_custom_checks_nonpy()
         for call_args in mock_custom_check_file.call_args_list:
             rule_set = call_args[0][2]
             self.all_rules.extend(rule_set)
예제 #2
0
 def setUp(self):
     # type: () -> None
     self.all_rules = []  # type: List[Dict[str, Any]]
     with patch('tools.linter_lib.custom_check.custom_check_file', return_value=False) as mock_custom_check_file:
         by_lang = dict.fromkeys(['py', 'js', 'sh', 'css', 'handlebars', 'html', 'json', 'md', 'txt', 'text', 'yaml'],
                                 ['foo/bar.baz'])
         check_custom_checks_py, check_custom_checks_nonpy = build_custom_checkers(by_lang)
         check_custom_checks_py()
         check_custom_checks_nonpy()
         for call_args in mock_custom_check_file.call_args_list:
             rule_set = call_args[0][2]
             self.all_rules.extend(rule_set)