Skip to content

Commit 9e179ef

Browse files
committed
feat(types[ConfigStyle]) Add ConfigStyle enum and RawRepoEntry alias
why: Centralize the three config output styles (concise, standard, verbose) as a typed enum so all commands share the same vocabulary. what: - Add ConfigStyle enum with CONCISE, STANDARD, VERBOSE values - Add RawRepoEntry TypeAlias (str | dict[str, Any])
1 parent 3fe369a commit 9e179ef

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

src/vcspull/types.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
from __future__ import annotations
3131

32+
import enum
3233
import pathlib
3334
import typing as t
3435
from typing import TypeAlias
@@ -40,6 +41,26 @@
4041
from libvcs.sync.git import GitSyncRemoteDict
4142

4243

44+
class ConfigStyle(enum.Enum):
45+
"""Output style for repository entries in vcspull configuration files.
46+
47+
Examples
48+
--------
49+
>>> from vcspull.types import ConfigStyle
50+
>>> ConfigStyle("concise")
51+
<ConfigStyle.CONCISE: 'concise'>
52+
>>> ConfigStyle.STANDARD.value
53+
'standard'
54+
"""
55+
56+
CONCISE = "concise"
57+
STANDARD = "standard"
58+
VERBOSE = "verbose"
59+
60+
61+
RawRepoEntry: TypeAlias = "str | dict[str, t.Any]"
62+
63+
4364
class RawConfigDict(t.TypedDict):
4465
"""Configuration dictionary without any type marshalling or variable resolution."""
4566

0 commit comments

Comments
 (0)