From 3e121a54f95219627acaa3e77d8ba18abe9e7a36 Mon Sep 17 00:00:00 2001 From: ashmichheda Date: Mon, 13 Nov 2023 14:46:46 -0800 Subject: [PATCH 01/10] fix: add filter to remove empty strs --- yapf/__init__.py | 2 ++ yapftests/main_test.py | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/yapf/__init__.py b/yapf/__init__.py index cf4be9379..97ba586c4 100644 --- a/yapf/__init__.py +++ b/yapf/__init__.py @@ -108,6 +108,8 @@ def main(argv): source = [line.rstrip() for line in original_source] source[0] = _removeBOM(source[0]) + # filter all the tuples with empty space + source = list(filter(None, source)) try: reformatted_source, _ = yapf_api.FormatCode( diff --git a/yapftests/main_test.py b/yapftests/main_test.py index b5d9b926e..0b6125b4e 100644 --- a/yapftests/main_test.py +++ b/yapftests/main_test.py @@ -137,3 +137,11 @@ def testHelp(self): self.assertIn('indent_width=4', help_message) self.assertIn('The number of spaces required before a trailing comment.', help_message) + def testExtraBlankLine(self): + code = 'if True:\n\n\n\n\t print(2)' + yapf_code = 'if True:\n print(2)\n' + with patched_input(code): + with captured_output() as (out, _): + ret = yapf.main([]) + self.assertEqual(ret, 0) + self.assertEqual(out.getvalue(), yapf_code) From 70a28e19142ad8944fa51a372837f61844420f8d Mon Sep 17 00:00:00 2001 From: ashmichheda Date: Tue, 14 Nov 2023 19:17:58 -0800 Subject: [PATCH 02/10] feat: add a util function to remove extra blank spaces --- yapf/__init__.py | 196 ++++++++++++++++++++++++++--------------------- 1 file changed, 107 insertions(+), 89 deletions(-) diff --git a/yapf/__init__.py b/yapf/__init__.py index 97ba586c4..56a160cad 100644 --- a/yapf/__init__.py +++ b/yapf/__init__.py @@ -54,6 +54,24 @@ def _removeBOM(source): return source +def filterEmptyTuples(source): + comment_start = False + quote_str = '\'\'\'' + reformatted_source = [] + for code_val in source: + if not comment_start and quote_str in code_val: + print("Starting quote") + reformatted_source.append(code_val) + comment_start = True + elif comment_start and quote_str in code_val: + comment_start = False + print("Ending quote") + reformatted_source.append(code_val) + elif code_val != '': + reformatted_source.append(code_val) + return reformatted_source + + def main(argv): """Main program. @@ -108,15 +126,15 @@ def main(argv): source = [line.rstrip() for line in original_source] source[0] = _removeBOM(source[0]) - # filter all the tuples with empty space - source = list(filter(None, source)) + # filter the tuples with empty spaces (excluding the disabled sections) + source = filterEmptyTuples(source) try: reformatted_source, _ = yapf_api.FormatCode( - str('\n'.join(source).replace('\r\n', '\n') + '\n'), - filename='', - style_config=style_config, - lines=lines) + str('\n'.join(source).replace('\r\n', '\n') + '\n'), + filename='', + style_config=style_config, + lines=lines) except errors.YapfError: raise except Exception as e: @@ -127,7 +145,7 @@ def main(argv): # Get additional exclude patterns from ignorefile exclude_patterns_from_ignore_file = file_resources.GetExcludePatternsForDir( - os.getcwd()) + os.getcwd()) files = file_resources.GetCommandLineFiles(args.files, args.recursive, (args.exclude or []) + @@ -136,16 +154,16 @@ def main(argv): raise errors.YapfError('input filenames did not match any python files') changed = FormatFiles( - files, - lines, - style_config=args.style, - no_local_style=args.no_local_style, - in_place=args.in_place, - print_diff=args.diff, - parallel=args.parallel, - quiet=args.quiet, - verbose=args.verbose, - print_modified=args.print_modified) + files, + lines, + style_config=args.style, + no_local_style=args.no_local_style, + in_place=args.in_place, + print_diff=args.diff, + parallel=args.parallel, + quiet=args.quiet, + verbose=args.verbose, + print_modified=args.print_modified) return 1 if changed and (args.diff or args.quiet) else 0 @@ -205,9 +223,9 @@ def FormatFiles(filenames, workers = min(multiprocessing.cpu_count(), len(filenames)) with concurrent.futures.ProcessPoolExecutor(workers) as executor: future_formats = [ - executor.submit(_FormatFile, filename, lines, style_config, - no_local_style, in_place, print_diff, quiet, verbose, - print_modified) for filename in filenames + executor.submit(_FormatFile, filename, lines, style_config, + no_local_style, in_place, print_diff, quiet, verbose, + print_modified) for filename in filenames ] for future in concurrent.futures.as_completed(future_formats): changed |= future.result() @@ -234,16 +252,16 @@ def _FormatFile(filename, if style_config is None and not no_local_style: style_config = file_resources.GetDefaultStyleForDir( - os.path.dirname(filename)) + os.path.dirname(filename)) try: reformatted_code, encoding, has_change = yapf_api.FormatFile( - filename, - in_place=in_place, - style_config=style_config, - lines=lines, - print_diff=print_diff, - logger=logging.warning) + filename, + in_place=in_place, + style_config=style_config, + lines=lines, + print_diff=print_diff, + logger=logging.warning) except errors.YapfError: raise except Exception as e: @@ -289,88 +307,88 @@ def _BuildParser(): An ArgumentParser instance for the CLI. """ parser = argparse.ArgumentParser( - prog='yapf', description='Formatter for Python code.') + prog='yapf', description='Formatter for Python code.') parser.add_argument( - '-v', - '--version', - action='version', - version='%(prog)s {}'.format(__version__)) + '-v', + '--version', + action='version', + version='%(prog)s {}'.format(__version__)) diff_inplace_quiet_group = parser.add_mutually_exclusive_group() diff_inplace_quiet_group.add_argument( - '-d', - '--diff', - action='store_true', - help='print the diff for the fixed source') + '-d', + '--diff', + action='store_true', + help='print the diff for the fixed source') diff_inplace_quiet_group.add_argument( - '-i', - '--in-place', - action='store_true', - help='make changes to files in place') + '-i', + '--in-place', + action='store_true', + help='make changes to files in place') diff_inplace_quiet_group.add_argument( - '-q', - '--quiet', - action='store_true', - help='output nothing and set return value') + '-q', + '--quiet', + action='store_true', + help='output nothing and set return value') lines_recursive_group = parser.add_mutually_exclusive_group() lines_recursive_group.add_argument( - '-r', - '--recursive', - action='store_true', - help='run recursively over directories') + '-r', + '--recursive', + action='store_true', + help='run recursively over directories') lines_recursive_group.add_argument( - '-l', - '--lines', - metavar='START-END', - action='append', - default=None, - help='range of lines to reformat, one-based') + '-l', + '--lines', + metavar='START-END', + action='append', + default=None, + help='range of lines to reformat, one-based') parser.add_argument( - '-e', - '--exclude', - metavar='PATTERN', - action='append', - default=None, - help='patterns for files to exclude from formatting') + '-e', + '--exclude', + metavar='PATTERN', + action='append', + default=None, + help='patterns for files to exclude from formatting') parser.add_argument( - '--style', - action='store', - help=('specify formatting style: either a style name (for example "pep8" ' - 'or "google"), or the name of a file with style settings. The ' - 'default is pep8 unless a %s or %s or %s file located in the same ' - 'directory as the source or one of its parent directories ' - '(for stdin, the current directory is used).' % - (style.LOCAL_STYLE, style.SETUP_CONFIG, style.PYPROJECT_TOML))) + '--style', + action='store', + help=('specify formatting style: either a style name (for example "pep8" ' + 'or "google"), or the name of a file with style settings. The ' + 'default is pep8 unless a %s or %s or %s file located in the same ' + 'directory as the source or one of its parent directories ' + '(for stdin, the current directory is used).' % + (style.LOCAL_STYLE, style.SETUP_CONFIG, style.PYPROJECT_TOML))) parser.add_argument( - '--style-help', - action='store_true', - help=('show style settings and exit; this output can be ' - 'saved to .style.yapf to make your settings ' - 'permanent')) + '--style-help', + action='store_true', + help=('show style settings and exit; this output can be ' + 'saved to .style.yapf to make your settings ' + 'permanent')) parser.add_argument( - '--no-local-style', - action='store_true', - help="don't search for local style definition") + '--no-local-style', + action='store_true', + help="don't search for local style definition") parser.add_argument( - '-p', - '--parallel', - action='store_true', - help=('run YAPF in parallel when formatting multiple files.')) + '-p', + '--parallel', + action='store_true', + help=('run YAPF in parallel when formatting multiple files.')) parser.add_argument( - '-m', - '--print-modified', - action='store_true', - help='print out file names of modified files') + '-m', + '--print-modified', + action='store_true', + help='print out file names of modified files') parser.add_argument( - '-vv', - '--verbose', - action='store_true', - help='print out file names while processing') + '-vv', + '--verbose', + action='store_true', + help='print out file names while processing') parser.add_argument( - 'files', nargs='*', help='reads from stdin when no files are specified.') + 'files', nargs='*', help='reads from stdin when no files are specified.') return parser From 3e0e9bc4c2c70793a50350f32e8a80719acd085d Mon Sep 17 00:00:00 2001 From: ashmichheda Date: Tue, 14 Nov 2023 19:18:48 -0800 Subject: [PATCH 03/10] refactor: adapt _FormatFinalLines for extra spaces --- yapf/yapflib/reformatter.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/yapf/yapflib/reformatter.py b/yapf/yapflib/reformatter.py index ff0952543..214c35ee6 100644 --- a/yapf/yapflib/reformatter.py +++ b/yapf/yapflib/reformatter.py @@ -16,7 +16,7 @@ The `logical_line.LogicalLine`s are now ready to be formatted. LogicalLInes that can be merged together are. The best formatting is returned as a string. - Reformat(): the main function exported by this module. + ): the main function exported by this module. """ import collections @@ -398,12 +398,19 @@ def _AlignTrailingComments(final_lines): def _FormatFinalLines(final_lines): """Compose the final output from the finalized lines.""" formatted_code = [] + comment_start = False + quote_str = '\'\'\'' for line in final_lines: formatted_line = [] for tok in line.tokens: if not tok.is_pseudo: - formatted_line.append(tok.formatted_whitespace_prefix) - formatted_line.append(tok.value) + if not comment_start and tok.value.startswith(quote_str): + comment_start = True + formatted_line.append(tok.formatted_whitespace_prefix) + formatted_line.append(tok.value) + else: + formatted_line.append(re.sub('\n+','\n',tok.formatted_whitespace_prefix)) + formatted_line.append(tok.value) elif (not tok.next_token.whitespace_prefix.startswith('\n') and not tok.next_token.whitespace_prefix.startswith(' ')): if (tok.previous_token.value == ':' or From e6c2d3e09e0886280b3021064e67caa4880051d0 Mon Sep 17 00:00:00 2001 From: ashmichheda Date: Tue, 14 Nov 2023 19:19:05 -0800 Subject: [PATCH 04/10] revert --- yapftests/main_test.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/yapftests/main_test.py b/yapftests/main_test.py index 0b6125b4e..b5d9b926e 100644 --- a/yapftests/main_test.py +++ b/yapftests/main_test.py @@ -137,11 +137,3 @@ def testHelp(self): self.assertIn('indent_width=4', help_message) self.assertIn('The number of spaces required before a trailing comment.', help_message) - def testExtraBlankLine(self): - code = 'if True:\n\n\n\n\t print(2)' - yapf_code = 'if True:\n print(2)\n' - with patched_input(code): - with captured_output() as (out, _): - ret = yapf.main([]) - self.assertEqual(ret, 0) - self.assertEqual(out.getvalue(), yapf_code) From e029155eda51dfdfb77c8e229a5038e831d2596e Mon Sep 17 00:00:00 2001 From: ashmichheda Date: Tue, 14 Nov 2023 19:19:20 -0800 Subject: [PATCH 05/10] test: add unit-test --- yapftests/reformatter_basic_test.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/yapftests/reformatter_basic_test.py b/yapftests/reformatter_basic_test.py index 74b1ba405..cdaef4fc8 100644 --- a/yapftests/reformatter_basic_test.py +++ b/yapftests/reformatter_basic_test.py @@ -16,6 +16,7 @@ import sys import textwrap import unittest +import yapf from yapf.yapflib import reformatter from yapf.yapflib import style @@ -3339,6 +3340,29 @@ def testParenthesizedContextManagers(self): llines = yapf_test_helper.ParseAndUnwrap(unformatted_code) self.assertCodeEqual(expected, reformatter.Reformat(llines)) + def testExtraBlankLine(self): + unformatted_code = textwrap.dedent("""\ + ''' + Comment section started + ''' + if True: + + + print(2) + """) + + #input_code = "\'\'\'\n Comment Section started\n\'\'\'\nif True:\n\n\n\t print(2)" + expected = textwrap.dedent("""\ + ''' + Comment section started + ''' + if True: + print(2) + """) + + llines = yapf_test_helper.ParseAndUnwrap(unformatted_code) + self.assertCodeEqual(expected, reformatter.Reformat(llines)) + if __name__ == '__main__': unittest.main() From 4014126621633160abf9b007a97fa175f840aad6 Mon Sep 17 00:00:00 2001 From: ashmichheda Date: Tue, 14 Nov 2023 19:20:49 -0800 Subject: [PATCH 06/10] refactor: remove print statements --- yapf/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/yapf/__init__.py b/yapf/__init__.py index 56a160cad..907e9e680 100644 --- a/yapf/__init__.py +++ b/yapf/__init__.py @@ -60,12 +60,10 @@ def filterEmptyTuples(source): reformatted_source = [] for code_val in source: if not comment_start and quote_str in code_val: - print("Starting quote") reformatted_source.append(code_val) comment_start = True elif comment_start and quote_str in code_val: comment_start = False - print("Ending quote") reformatted_source.append(code_val) elif code_val != '': reformatted_source.append(code_val) From 32c783da8f137d32b86218631fbfd2768142bf71 Mon Sep 17 00:00:00 2001 From: ashmichheda Date: Tue, 14 Nov 2023 19:24:06 -0800 Subject: [PATCH 07/10] revert changes --- yapf/__init__.py | 181 ++++++++++++++++++++++++----------------------- 1 file changed, 92 insertions(+), 89 deletions(-) diff --git a/yapf/__init__.py b/yapf/__init__.py index 907e9e680..81918a5c2 100644 --- a/yapf/__init__.py +++ b/yapf/__init__.py @@ -54,6 +54,7 @@ def _removeBOM(source): return source +<<<<<<< HEAD def filterEmptyTuples(source): comment_start = False quote_str = '\'\'\'' @@ -70,6 +71,8 @@ def filterEmptyTuples(source): return reformatted_source +======= +>>>>>>> parent of 70a28e1 (feat: add a util function to remove extra blank spaces) def main(argv): """Main program. @@ -124,15 +127,15 @@ def main(argv): source = [line.rstrip() for line in original_source] source[0] = _removeBOM(source[0]) - # filter the tuples with empty spaces (excluding the disabled sections) - source = filterEmptyTuples(source) + # filter all the tuples with empty space + source = list(filter(None, source)) try: reformatted_source, _ = yapf_api.FormatCode( - str('\n'.join(source).replace('\r\n', '\n') + '\n'), - filename='', - style_config=style_config, - lines=lines) + str('\n'.join(source).replace('\r\n', '\n') + '\n'), + filename='', + style_config=style_config, + lines=lines) except errors.YapfError: raise except Exception as e: @@ -143,7 +146,7 @@ def main(argv): # Get additional exclude patterns from ignorefile exclude_patterns_from_ignore_file = file_resources.GetExcludePatternsForDir( - os.getcwd()) + os.getcwd()) files = file_resources.GetCommandLineFiles(args.files, args.recursive, (args.exclude or []) + @@ -152,16 +155,16 @@ def main(argv): raise errors.YapfError('input filenames did not match any python files') changed = FormatFiles( - files, - lines, - style_config=args.style, - no_local_style=args.no_local_style, - in_place=args.in_place, - print_diff=args.diff, - parallel=args.parallel, - quiet=args.quiet, - verbose=args.verbose, - print_modified=args.print_modified) + files, + lines, + style_config=args.style, + no_local_style=args.no_local_style, + in_place=args.in_place, + print_diff=args.diff, + parallel=args.parallel, + quiet=args.quiet, + verbose=args.verbose, + print_modified=args.print_modified) return 1 if changed and (args.diff or args.quiet) else 0 @@ -221,9 +224,9 @@ def FormatFiles(filenames, workers = min(multiprocessing.cpu_count(), len(filenames)) with concurrent.futures.ProcessPoolExecutor(workers) as executor: future_formats = [ - executor.submit(_FormatFile, filename, lines, style_config, - no_local_style, in_place, print_diff, quiet, verbose, - print_modified) for filename in filenames + executor.submit(_FormatFile, filename, lines, style_config, + no_local_style, in_place, print_diff, quiet, verbose, + print_modified) for filename in filenames ] for future in concurrent.futures.as_completed(future_formats): changed |= future.result() @@ -250,16 +253,16 @@ def _FormatFile(filename, if style_config is None and not no_local_style: style_config = file_resources.GetDefaultStyleForDir( - os.path.dirname(filename)) + os.path.dirname(filename)) try: reformatted_code, encoding, has_change = yapf_api.FormatFile( - filename, - in_place=in_place, - style_config=style_config, - lines=lines, - print_diff=print_diff, - logger=logging.warning) + filename, + in_place=in_place, + style_config=style_config, + lines=lines, + print_diff=print_diff, + logger=logging.warning) except errors.YapfError: raise except Exception as e: @@ -305,88 +308,88 @@ def _BuildParser(): An ArgumentParser instance for the CLI. """ parser = argparse.ArgumentParser( - prog='yapf', description='Formatter for Python code.') + prog='yapf', description='Formatter for Python code.') parser.add_argument( - '-v', - '--version', - action='version', - version='%(prog)s {}'.format(__version__)) + '-v', + '--version', + action='version', + version='%(prog)s {}'.format(__version__)) diff_inplace_quiet_group = parser.add_mutually_exclusive_group() diff_inplace_quiet_group.add_argument( - '-d', - '--diff', - action='store_true', - help='print the diff for the fixed source') + '-d', + '--diff', + action='store_true', + help='print the diff for the fixed source') diff_inplace_quiet_group.add_argument( - '-i', - '--in-place', - action='store_true', - help='make changes to files in place') + '-i', + '--in-place', + action='store_true', + help='make changes to files in place') diff_inplace_quiet_group.add_argument( - '-q', - '--quiet', - action='store_true', - help='output nothing and set return value') + '-q', + '--quiet', + action='store_true', + help='output nothing and set return value') lines_recursive_group = parser.add_mutually_exclusive_group() lines_recursive_group.add_argument( - '-r', - '--recursive', - action='store_true', - help='run recursively over directories') + '-r', + '--recursive', + action='store_true', + help='run recursively over directories') lines_recursive_group.add_argument( - '-l', - '--lines', - metavar='START-END', - action='append', - default=None, - help='range of lines to reformat, one-based') + '-l', + '--lines', + metavar='START-END', + action='append', + default=None, + help='range of lines to reformat, one-based') parser.add_argument( - '-e', - '--exclude', - metavar='PATTERN', - action='append', - default=None, - help='patterns for files to exclude from formatting') + '-e', + '--exclude', + metavar='PATTERN', + action='append', + default=None, + help='patterns for files to exclude from formatting') parser.add_argument( - '--style', - action='store', - help=('specify formatting style: either a style name (for example "pep8" ' - 'or "google"), or the name of a file with style settings. The ' - 'default is pep8 unless a %s or %s or %s file located in the same ' - 'directory as the source or one of its parent directories ' - '(for stdin, the current directory is used).' % - (style.LOCAL_STYLE, style.SETUP_CONFIG, style.PYPROJECT_TOML))) + '--style', + action='store', + help=('specify formatting style: either a style name (for example "pep8" ' + 'or "google"), or the name of a file with style settings. The ' + 'default is pep8 unless a %s or %s or %s file located in the same ' + 'directory as the source or one of its parent directories ' + '(for stdin, the current directory is used).' % + (style.LOCAL_STYLE, style.SETUP_CONFIG, style.PYPROJECT_TOML))) parser.add_argument( - '--style-help', - action='store_true', - help=('show style settings and exit; this output can be ' - 'saved to .style.yapf to make your settings ' - 'permanent')) + '--style-help', + action='store_true', + help=('show style settings and exit; this output can be ' + 'saved to .style.yapf to make your settings ' + 'permanent')) parser.add_argument( - '--no-local-style', - action='store_true', - help="don't search for local style definition") + '--no-local-style', + action='store_true', + help="don't search for local style definition") parser.add_argument( - '-p', - '--parallel', - action='store_true', - help=('run YAPF in parallel when formatting multiple files.')) + '-p', + '--parallel', + action='store_true', + help=('run YAPF in parallel when formatting multiple files.')) parser.add_argument( - '-m', - '--print-modified', - action='store_true', - help='print out file names of modified files') + '-m', + '--print-modified', + action='store_true', + help='print out file names of modified files') parser.add_argument( - '-vv', - '--verbose', - action='store_true', - help='print out file names while processing') + '-vv', + '--verbose', + action='store_true', + help='print out file names while processing') parser.add_argument( - 'files', nargs='*', help='reads from stdin when no files are specified.') + 'files', nargs='*', help='reads from stdin when no files are specified.') return parser From db7e17c0e785b05becc3b1485691f09d0d699f11 Mon Sep 17 00:00:00 2001 From: ashmichheda Date: Tue, 14 Nov 2023 19:26:27 -0800 Subject: [PATCH 08/10] feat: add a util function to remove extra blank spaces --- yapf/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/yapf/__init__.py b/yapf/__init__.py index 81918a5c2..088ee614d 100644 --- a/yapf/__init__.py +++ b/yapf/__init__.py @@ -54,7 +54,6 @@ def _removeBOM(source): return source -<<<<<<< HEAD def filterEmptyTuples(source): comment_start = False quote_str = '\'\'\'' @@ -71,8 +70,6 @@ def filterEmptyTuples(source): return reformatted_source -======= ->>>>>>> parent of 70a28e1 (feat: add a util function to remove extra blank spaces) def main(argv): """Main program. @@ -128,7 +125,7 @@ def main(argv): source = [line.rstrip() for line in original_source] source[0] = _removeBOM(source[0]) # filter all the tuples with empty space - source = list(filter(None, source)) + source = filterEmptyTuples(source) try: reformatted_source, _ = yapf_api.FormatCode( From 4fab04b335c27152ac87eb070f9805386225286e Mon Sep 17 00:00:00 2001 From: ashmichheda Date: Tue, 14 Nov 2023 19:28:41 -0800 Subject: [PATCH 09/10] code cleanup --- yapf/yapflib/reformatter.py | 2 +- yapftests/reformatter_basic_test.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/yapf/yapflib/reformatter.py b/yapf/yapflib/reformatter.py index 214c35ee6..62374283b 100644 --- a/yapf/yapflib/reformatter.py +++ b/yapf/yapflib/reformatter.py @@ -16,7 +16,7 @@ The `logical_line.LogicalLine`s are now ready to be formatted. LogicalLInes that can be merged together are. The best formatting is returned as a string. - ): the main function exported by this module. + Reformat(): the main function exported by this module. """ import collections diff --git a/yapftests/reformatter_basic_test.py b/yapftests/reformatter_basic_test.py index cdaef4fc8..a03b7e514 100644 --- a/yapftests/reformatter_basic_test.py +++ b/yapftests/reformatter_basic_test.py @@ -16,7 +16,6 @@ import sys import textwrap import unittest -import yapf from yapf.yapflib import reformatter from yapf.yapflib import style From 6bddabac363a30c81116f2d15b98519ecd096bf0 Mon Sep 17 00:00:00 2001 From: ashmichheda Date: Wed, 15 Nov 2023 18:20:46 -0800 Subject: [PATCH 10/10] code cleanup --- yapftests/reformatter_basic_test.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/yapftests/reformatter_basic_test.py b/yapftests/reformatter_basic_test.py index a03b7e514..b266dd44c 100644 --- a/yapftests/reformatter_basic_test.py +++ b/yapftests/reformatter_basic_test.py @@ -3349,8 +3349,6 @@ def testExtraBlankLine(self): print(2) """) - - #input_code = "\'\'\'\n Comment Section started\n\'\'\'\nif True:\n\n\n\t print(2)" expected = textwrap.dedent("""\ ''' Comment section started