Beispiel #1
0
    def fixes_syntax(self):
        """
        Return True if the commit fixes a syntax issue.

        Returns
        -------
        bool
            True if the commit fixes syntnax. False, otherwise.

        """

        for sentence in self.sentences:
            sentence = ' '.join(sentence)
            sentence_dep = ' '.join(utils.get_head_dependents(sentence))
            if rules.has_defect_pattern(sentence) and rules.has_syntax_pattern(
                    sentence_dep):
                return True

        return False
 def test_has_syntax_pattern_false():
     assert not rules.has_syntax_pattern('refactored code')
 def test_has_syntax_pattern_true():
     assert rules.has_syntax_pattern('Fix lint issue')