Skip to content

Does --pyink-lines work with stdin? #16

@kuator

Description

@kuator

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions