mypy_path option split on [:,] before environment variable expansion
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Hi,
given an environment variable composed of multiple path, eg export A=/foo:/bar, using the following mypy.ini fails to recognize the two paths foo and bar
[mypy]
mypy_path = $A
This is a consequence of splitting the option on [:,] before expanding environment variables. (https://github.com/python/mypy/blob/master/mypy/config_parser.py#L85)
Would it be sufficient / not harmful to replace the parsing function with the following ?
lambda s: re.split('[,:]', expand_path(s.strip()))
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in mypy/config_parser.py around line 85 and reproduce the issue with the shown mypy.ini and environment variable A. Check the path splitting and expansion order; done means a value such as $A expands into both /foo and /bar and both paths are recognized.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100