When I use --pyink-lines on a file, it works as expected, it reformats required lines. But when I read the same file from stdin, it reformats everything we pass to it.
$ echo 'if True: print("CHANGED TEXT")\nif False: print("there")' > test.py
$ cat test.py
if True: print("CHANGED TEXT")
if False: print("there")
$ pyink test.py --pyink-lines=1-1 --quiet && cat test.py
if True:
print("CHANGED TEXT")
if False: print("there")
It reformatted only the lines we issued. When I try to use stdin though, it reformats everything.
$ echo 'if True: print("CHANGED TEXT")\nif False: print("there")' > test.py
$ cat test.py
if True: print("CHANGED TEXT")
if False: print("there")
$ cat test.py | pyink --quiet --pyink-lines=1-1 -
if True:
print("CHANGED TEXT")
if False:
print("there")
As you can see, it reformats everything.
When I use
--pyink-lineson a file, it works as expected, it reformats required lines. But when I read the same file fromstdin, it reformats everything we pass to it.It reformatted only the lines we issued. When I try to use
stdinthough, it reformats everything.As you can see, it reformats everything.