How to use the gitlint.utils.filter_lines function in gitlint

To help you get started, we’ve selected a few gitlint examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sk- / git-lint / test / unittest / test_utils.py View on Github external
def test_filter_lines_one_group(self):
        lines = ['1: foo', '12: bar', '', 'Debug: info']
        self.assertEqual(
            ['1', '12'],
            list(utils.filter_lines(lines,
                                    r'(?P
github sk- / git-lint / test / unittest / test_utils.py View on Github external
def test_filter_lines_no_groups(self):
        lines = ['a', 'b', 'c', 'ad']
        self.assertEqual(lines, list(utils.filter_lines(lines, '.')))
        self.assertEqual(['a', 'ad'], list(utils.filter_lines(lines, 'a')))
        self.assertEqual(['ad'], list(utils.filter_lines(lines, '.d')))
        self.assertEqual(['ad'], list(utils.filter_lines(lines, 'd')))
        self.assertEqual([], list(utils.filter_lines(lines, '^d')))
        self.assertEqual([], list(utils.filter_lines(lines, 'foo')))
github sk- / git-lint / test / unittest / test_utils.py View on Github external
def test_filter_lines_no_groups(self):
        lines = ['a', 'b', 'c', 'ad']
        self.assertEqual(lines, list(utils.filter_lines(lines, '.')))
        self.assertEqual(['a', 'ad'], list(utils.filter_lines(lines, 'a')))
        self.assertEqual(['ad'], list(utils.filter_lines(lines, '.d')))
        self.assertEqual(['ad'], list(utils.filter_lines(lines, 'd')))
        self.assertEqual([], list(utils.filter_lines(lines, '^d')))
        self.assertEqual([], list(utils.filter_lines(lines, 'foo')))
github sk- / git-lint / test / unittest / test_utils.py View on Github external
def test_filter_lines_many_groups(self):
        lines = ['1: foo', '12: bar', '', 'Debug: info']
        self.assertEqual(
            [('1', 'foo'), ('12', 'bar')],
            list(utils.filter_lines(lines,
                                    r'(?P