Rewrite the mypy comment syntax into ini file syntax.
(line: str, template: Options)
| 635 | |
| 636 | |
| 637 | def mypy_comments_to_config_map(line: str, template: Options) -> tuple[dict[str, str], list[str]]: |
| 638 | """Rewrite the mypy comment syntax into ini file syntax.""" |
| 639 | options = {} |
| 640 | entries, errors = split_directive(line) |
| 641 | for entry in entries: |
| 642 | if "=" not in entry: |
| 643 | name = entry |
| 644 | value = None |
| 645 | else: |
| 646 | name, value = (x.strip() for x in entry.split("=", 1)) |
| 647 | |
| 648 | name = name.replace("-", "_") |
| 649 | if value is None: |
| 650 | value = "True" |
| 651 | options[name] = value |
| 652 | |
| 653 | return options, errors |
| 654 | |
| 655 | |
| 656 | def parse_mypy_comments( |
no test coverage detected
searching dependent graphs…