コード例 #1
0
def test_run():
    config = build_review_config(simple_ini)
    problems = Problems()
    files = ['./tests/fixtures/pep8/has_errors.py']
    tool_list = tools.factory(config, problems, root_dir)
    tools.run(tool_list, files, [])
    eq_(7, len(problems))
コード例 #2
0
ファイル: test_tools.py プロジェクト: markstory/lint-review
 def test_run(self):
     config = build_review_config(simple_ini)
     problems = Problems()
     files = ['./tests/fixtures/pep8/has_errors.py']
     tool_list = tools.factory(config, problems, root_dir)
     tools.run(tool_list, files, [])
     self.assertEqual(7, len(problems))
コード例 #3
0
 def run_tools(self, repo_config):
     if not self._changes:
         raise RuntimeError('No loaded changes, cannot run tools. '
                            'Try calling load_changes first.')
     files_to_check = self._changes.get_files(append_base=self._target_path)
     tools.run(repo_config, self._problems, files_to_check,
               self._target_path)
コード例 #4
0
ファイル: processor.py プロジェクト: markstory/lint-review
 def run_tools(self, review_config):
     if self._changes is None:
         raise RuntimeError("No loaded changes, cannot run tools. " "Try calling load_changes first.")
     files_to_check = self._changes.get_files(
         append_base=self._target_path, ignore_patterns=review_config.ignore_patterns()
     )
     commits_to_check = self._pull_request.commits()
     tools.run(review_config, self._problems, files_to_check, commits_to_check, self._target_path)
コード例 #5
0
def test_run__filter_files():
    config = build_review_config(simple_ini)
    problems = Problems()
    files = [
        './tests/fixtures/pep8/has_errors.py',
        './tests/fixtures/phpcs/has_errors.php'
    ]
    tools.run(config, problems, files, [], '')
    eq_(6, len(problems))
コード例 #6
0
ファイル: test_tools.py プロジェクト: Ronan-/lint-review
def test_run__filter_files():
    config = build_review_config(simple_ini)
    problems = Problems()
    files = [
        './tests/fixtures/pep8/has_errors.py',
        './tests/fixtures/phpcs/has_errors.php'
    ]
    tools.run(config, problems, files, [], '')
    eq_(6, len(problems))
コード例 #7
0
 def test_run__filter_files(self):
     config = build_review_config(simple_ini)
     problems = Problems()
     files = [
         './tests/fixtures/pep8/has_errors.py',
         './tests/fixtures/phpcs/has_errors.php'
     ]
     tool_list = tools.factory(config, problems, root_dir)
     tools.run(tool_list, files, [])
     self.assertEqual(7, len(problems))
コード例 #8
0
 def run_tools(self, review_config):
     if self._changes is None:
         raise RuntimeError('No loaded changes, cannot run tools. '
                            'Try calling load_changes first.')
     files_to_check = self._changes.get_files(
         append_base=self._target_path,
         ignore_patterns=review_config.ignore_patterns())
     commits_to_check = self._pull_request.commits()
     tools.run(review_config, self._problems, files_to_check,
               commits_to_check, self._target_path)
コード例 #9
0
ファイル: processor.py プロジェクト: colindecarlo/lint-review
 def run_tools(self, repo_config):
     if not self._changes:
         raise RuntimeError('No loaded changes, cannot run tools. '
                            'Try calling load_changes first.')
     files_to_check = self._changes.get_files(append_base=self._target_path)
     tools.run(
         repo_config,
         self._problems,
         files_to_check,
         self._target_path)
コード例 #10
0
ファイル: test_tools.py プロジェクト: markstory/lint-review
    def test_run_timeout_error(self, mock_docker):
        mock_docker.side_effect = TimeoutError("Read timed out. (read timeout=300)")
        config = build_review_config(simple_ini)
        problems = Problems()
        files = ['./tests/fixtures/pep8/has_errors.py']
        tool_list = tools.factory(config, problems, root_dir)
        tools.run(tool_list, files, [])

        errors = problems.all()
        assert 1 == len(errors)
        assert 'timed out during' in errors[0].body
        assert 'run pep8 linter' in errors[0].body
コード例 #11
0
    def test_run_timeout_error(self, mock_docker):
        mock_docker.side_effect = TimeoutError(
            "Read timed out. (read timeout=300)")
        config = build_review_config(simple_ini)
        problems = Problems()
        files = ['./tests/fixtures/pep8/has_errors.py']
        tool_list = tools.factory(config, problems, root_dir)
        tools.run(tool_list, files, [])

        errors = problems.all()
        assert 1 == len(errors)
        assert 'timed out during' in errors[0].body
        assert 'run pep8 linter' in errors[0].body
コード例 #12
0
    def run_tools(self, review_config):
        if self._changes is None:
            raise RuntimeError('No loaded changes, cannot run tools. '
                               'Try calling load_changes first.')
        files_to_check = self._changes.get_files(
            ignore_patterns=review_config.ignore_patterns())
        commits_to_check = self._pull_request.commits()

        tool_list = tools.factory(review_config, self.problems,
                                  self._target_path)

        if review_config.fixers_enabled():
            self.apply_fixers(review_config, tool_list, files_to_check)

        tools.run(tool_list, files_to_check, commits_to_check)
コード例 #13
0
ファイル: processor.py プロジェクト: markstory/lint-review
    def run_tools(self):
        if self._changes is None:
            raise RuntimeError('No loaded changes, cannot run tools. '
                               'Try calling load_changes first.')
        config = self._config

        files_to_check = self._changes.get_files(
            ignore_patterns=config.ignore_patterns()
        )
        commits_to_check = self._pull_request.commits()

        tool_list = tools.factory(
            config,
            self.problems,
            self._target_path)

        if config.fixers_enabled():
            self.apply_fixers(tool_list, files_to_check)

        tools.run(tool_list, files_to_check, commits_to_check)
コード例 #14
0
ファイル: processor.py プロジェクト: vrutkovs/lint-review
 def run_tools(self, review_config):
     if self._changes is None:
         raise RuntimeError('No loaded changes, cannot run tools. '
                            'Try calling load_changes first.')
     files_to_check = self._changes.get_files(
         append_base=self._target_path,
         ignore_patterns=review_config.ignore_patterns())
     commits_to_check = self._pull_request.commits()
     log.debug("_problems before tools: %s" % len(self._problems))
     self._problems = tools.run(
         review_config,
         self._problems,
         files_to_check,
         commits_to_check,
         self._target_path)
     log.debug("_problems after tools: %s" % len(self._problems))
コード例 #15
0
def test_run():
    config = ReviewConfig(simple_ini)
    problems = Problems()
    files = ['./tests/fixtures/pep8/has_errors.py']
    tools.run(config, problems, files, [], '')
    eq_(6, len(problems))
コード例 #16
0
ファイル: test_tools.py プロジェクト: pSub/lint-review
def test_run__filter_files():
    config = ReviewConfig(simple_ini)
    problems = Problems()
    files = ["./tests/fixtures/pep8/has_errors.py", "./tests/fixtures/phpcs/has_errors.php"]
    tools.run(config, problems, files, [], "")
    eq_(6, len(problems))