MCPcopy Index your code
hub / github.com/python/mypy / parse_cwd

Function parse_cwd

mypy/test/testcmdline.py:141–153  ·  view source on GitHub ↗

Parse the second line of the program for the command line. This should have the form # cwd: For example: # cwd: main/subdir

(line: str)

Source from the content-addressed store, hash-verified

139
140
141def parse_cwd(line: str) -> str | None:
142 """Parse the second line of the program for the command line.
143
144 This should have the form
145
146 # cwd: <directory>
147
148 For example:
149
150 # cwd: main/subdir
151 """
152 m = re.match("# cwd: (.*)$", line)
153 return m.group(1) if m else None
154
155
156def normalize_devnull(line: str) -> str:

Callers 1

test_python_cmdlineFunction · 0.85

Calls 1

groupMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…