- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 3k
 
Enable pretty by default #19510
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
base: master
Are you sure you want to change the base?
Enable pretty by default #19510
Changes from all commits
f94fc8f
              54a0196
              e0d968e
              201f436
              9d498a8
              0a9e326
              f07217d
              d4de5a7
              ce8cc29
              7b79b5a
              d67c367
              afc6585
              23e5980
              66121c9
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| 
          
            
          
           | 
    @@ -79,6 +79,18 @@ def parse_script(input: list[str]) -> list[list[str]]: | |
| def run_cmd(input: str) -> tuple[int, str]: | ||
| if input[1:].startswith("mypy run --") and "--show-error-codes" not in input: | ||
| input += " --hide-error-codes" | ||
| is_pretty_test = "# NO-MODIFY" in input | ||
| 
         There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I must be missing something - why won't just checking for  There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello @sterliakov , this is still my main approach and it is also partly working in the this test-runner to maintain the consistent behavior with all other test-runners.However, I discovered a critical technical constraint: the  The formatting flags must be directly passed to the server, which only worked in these two ways for me: Because the testcases contains a mix of commands where the flag will and won't work, I had to make  For demonstration: In this case, my first approach was to insert the  I understand that this is a very bare-bones workaround, and I am open to any suggestions to make it cleaner.  | 
||
| modified_input = input.replace("# NO-MODIFY", "").strip() | ||
| cond1 = "--pretty" not in modified_input | ||
| cond2 = modified_input.startswith(("dmypy run", "dmypy check")) | ||
| cond3 = not is_pretty_test | ||
| if cond1 and cond2 and cond3: | ||
| parts = modified_input.split(" ", 2) | ||
| command, subcommand = parts[0], parts[1] | ||
| args = parts[2] if len(parts) > 2 else "" | ||
| input = f"{command} {subcommand} {args} --no-pretty".strip() | ||
| else: | ||
| input = modified_input | ||
| if input.startswith("dmypy "): | ||
| input = sys.executable + " -m mypy." + input | ||
| if input.startswith("mypy "): | ||
| 
          
            
          
           | 
    ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.