New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gsoc: Fix colors from the output #4627

Merged
merged 2 commits into from Aug 24, 2017
Jump to file or symbol
Failed to load files and symbols.
+12 −12
Diff settings

Always

Just for now

Viewing a subset of changes. View all
Prev

Add line number inside "[ ]" in diffs

  • Loading branch information...
Nosferatul committed Aug 23, 2017
commit 377585d14cac6522546c9dc0a94f2890304eb7a5
@@ -110,7 +110,7 @@ def color_letter(console_printer, line):
def format_lines(lines, symbol='', line_nr=''):
def sym(x): return ']' if x is '[' else x
return '\n'.join('{}{:>5}{} {}'.format(symbol, sym(symbol), line_nr, line)
return '\n'.join('{}{:>4}{} {}'.format(symbol, line_nr, sym(symbol), line)
for line in lines.rstrip('\n').split('\n'))
@@ -662,7 +662,7 @@ def test_print_results_for_file(self):
self.console_printer)
self.assertEqual("""
filename
[ ]2 {0}
[ 2] {0}
**** SpaceConsistencyBear [Section: | Severity: NORMAL] ****
! ! {1}\n""".format(highlight_text(self.no_color, 'line 2', NoColorStyle,
self.lexer),
@@ -688,7 +688,7 @@ def test_print_results_for_file(self):
self.console_printer)
self.assertEqual("""
filename
[ ]5 {0}
[ 5] {0}
**** SpaceConsistencyBear [Section: | Severity: NORMAL] ****
! ! {1}\n""".format(highlight_text(self.no_color, 'line 5', NoColorStyle,
self.lexer),
@@ -719,12 +719,12 @@ def test_print_results_sorting(self):
self.assertEqual("""
file
[ ]2 {0}
[ 2] {0}
**** SpaceConsistencyBear [Section: | Severity: NORMAL] ****
! ! Trailing whitespace found
file
[ ]5 {2}
[ 5] {2}
**** SpaceConsistencyBear [Section: | Severity: NORMAL] ****
! ! {1}\n""".format(highlight_text(self.no_color, '\t', NoColorStyle,
self.lexer),
@@ -755,15 +755,15 @@ def test_print_results_multiple_ranges(self):
self.console_printer)
self.assertEqual("""
another_file
[ ]1 li{0}{1}
[ 1] li{0}{1}
another_file
[ ]3 li{0}{2}
[ 3] li{0}{2}
some_file
[ ]5 li{0}{3}
[ ]6 li{0}{4}
[ ]7 li{0}{5}
[ 5] li{0}{3}
[ 6] li{0}{4}
[ 7] li{0}{5}
**** ClangCloneDetectionBear [Section: | Severity: NORMAL] ****
! ! {6}\n""".format(highlight_text(self.no_color, 'ne',
BackgroundSourceRangeStyle, self.lexer),
@@ -818,13 +818,13 @@ def test_print_results_missing_line(self):
self.console_printer)
self.assertEqual(
'\nfile\n'
'[ ]5 {0}'
'[ 5] {0}'
'\n'
'**** t [Section: | Severity: NORMAL] ****\n'
'! ! {1}\n'
'\n'
'file\n'
'! !6 {2}'
'! 6! {2}'
'\n'
'**** t [Section: | Severity: NORMAL] ****\n'
'! ! {1}\n'.format(
ProTip! Use n and p to navigate between commits in a pull request.