Parse the first line of the program for the command line. This should have the form # cmd: mypy For example: # cmd: mypy pkg/
(line: str)
| 122 | |
| 123 | |
| 124 | def parse_args(line: str) -> list[str]: |
| 125 | """Parse the first line of the program for the command line. |
| 126 | |
| 127 | This should have the form |
| 128 | |
| 129 | # cmd: mypy <options> |
| 130 | |
| 131 | For example: |
| 132 | |
| 133 | # cmd: mypy pkg/ |
| 134 | """ |
| 135 | m = re.match("# cmd: mypy (.*)$", line) |
| 136 | if not m: |
| 137 | return [] # No args; mypy will spit out an error. |
| 138 | return m.group(1).split() |
| 139 | |
| 140 | |
| 141 | def parse_cwd(line: str) -> str | None: |
no test coverage detected
searching dependent graphs…