| import re | |
| from pathlib import Path | |
| ROOT_DIR = Path(__file__).resolve().parent.parent | |
| def dir_name(linter_name: str) -> str: | |
| return linter_name.replace("-", "_") | |
| def pascal_case(linter_name: str) -> str: | |
| """Convert from snake-case to PascalCase.""" | |
| return "".join(word.title() for word in linter_name.split("-")) | |
| def get_indent(line: str) -> str: | |
| return re.match(r"^\s*", line).group() # type: ignore[union-attr] |