Ejemplo n.º 1
0
 def apply_fixers(self, tool_list, files_to_check):
     try:
         fixer_context = fixers.create_context(
             self._config,
             self._target_path,
             self._repository,
             self._pull_request,
         )
         fixer_diff = fixers.run_fixers(tool_list, self._target_path,
                                        files_to_check)
         fixers.apply_fixer_diff(self._changes, fixer_diff, fixer_context)
     except (ConfigurationError, WorkflowError) as e:
         log.warn('Fixer application failed. Got %s', e)
         message = u'Unable to apply fixers. {}'.format(e)
         self.problems.add(IssueComment(message))
     except Exception as e:
         log.warn(
             'Fixer application failed, '
             'rolling back working tree. Got %s', e)
         fixers.rollback_changes(self._target_path)
Ejemplo n.º 2
0
 def apply_fixers(self, tool_list, files_to_check):
     try:
         fixer_context = fixers.create_context(
             self._config,
             self._target_path,
             self._repository,
             self._pull_request,
         )
         fixer_diff = fixers.run_fixers(
             tool_list,
             self._target_path,
             files_to_check)
         fixers.apply_fixer_diff(
             self._changes,
             fixer_diff,
             fixer_context)
     except (ConfigurationError, WorkflowError) as e:
         log.info('Fixer application failed. Got %s', e)
         message = u'Unable to apply fixers. {}'.format(e)
         self.problems.add(InfoComment(message))
     except Exception as e:
         log.info('Fixer application failed, '
                  'rolling back working tree. Got %s', e)
         fixers.rollback_changes(self._target_path)