Closed akx closed 2 years ago
Can you please provide a few examples of how user output will look after this change?
@ikamensh With flynt --dry-run .
in flynt's directory, the output is exactly the same.
Adding --verbose
, some examples of differences:
377c298
< Skipping conversion due to line length limit. Pass -ll 999 to increase it. (999 is an example, as number of characters.)
---
> Skipping conversion of 'Detected multiple Flask applications in module "{}". Use ''"FLASK_APP={}:name" to specify the correct ''one.' . format ( var1 , var2 ) due to line length limit. Pass -ll 999 to increase it. (999 is an example, as number of characters.)
390c311
< Skipping conversion due to line length limit. Pass -ll 999 to increase it. (999 is an example, as number of characters.)
---
> Skipping conversion of "Python %s on %s\nApp: %s [%s]\nInstance: %s" % ( sys . version , sys . platform , app . import_name , app . env , app . instance_path , ) due to line length limit. Pass -ll 999 to increase it. (999 is an example, as number of characters.)
501,506c422,451
< Failed to parse transformed code 'f"beautiful numbers to follow: {'\\t'.join(lst)}"' given original '"beautiful numbers to follow: {}" . format ( "\t" . join ( lst ) )'
---
> Failed to parse transformed code 'f"beautiful numbers to follow: {'\\t'.join(lst)}"'' given original '"beautiful numbers to follow: {}" . format ( "\t" . join ( lst ) )'
> Traceback (most recent call last):
> File "flynt/transform/transform.py", line 54, in transform_chunk
> ast.parse(new_code)
> File "lib/python3.10/ast.py", line 50, in parse
> return compile(source, filename, mode, flags,
> File "<unknown>", line 1
> f"beautiful numbers to follow: {'\\t'.join(lst)}"
> ^
1771,1772c1496,1497
< Exception Default text alignment has changed between percent fmt and fstrings. Proceeding would result in changed code behaviour. during conversion of code '"Setting %20r must be uppercase." % name'
< Exception Skipping %d formatting - fstrings behave differently from % formatting. during conversion of code ''%i' % i'
---
> Not converting code '"Setting %20r must be uppercase." % name': Default text alignment has changed between percent fmt and fstrings. Proceeding would result in changed code behaviour.
> Not converting code ''%i' % i': Skipping %d formatting - fstrings behave differently from % formatting.
As part of my Secret Grand Plan (not really, I just revealed it) of getting rid of the global
state
, this switchesprint()
s in non-"frontend" situations tologging
calls.TheVerbose logging output may look different from before.