Update in response to feedback

- one configuration option: ignore_paths
- use shlex to parse option to support whitespace and in-line comments
- change option type to Tuple[str, ...]
- remove ignored directories from dirnames to prevent scanning
This commit is contained in:
Suvayu Ali
2022-06-06 09:58:18 +02:00
parent eea652f1d0
commit 20b6a97159
6 changed files with 26 additions and 31 deletions

View File

@@ -3,6 +3,7 @@
# License: GPLv3 Copyright: 2021, Kovid Goyal <kovid at kovidgoyal.net>
import shlex
from typing import Any, Dict, Iterable, List, Tuple, Union
from kitty.conf.utils import (
@@ -58,8 +59,8 @@ def syntax_aliases(raw: str) -> Dict[str, str]:
return ans
def pattern_list(raw: str) -> List[str]:
return raw.split(' ')
def pattern_list(raw: str) -> Tuple[str, ...]:
return tuple(shlex.split(raw, comments=True))
def parse_map(val: str) -> Iterable[KittensKeyDefinition]: