diff --git a/libvcs/cmd/git.py b/libvcs/cmd/git.py index b1be900d2..75daa9531 100644 --- a/libvcs/cmd/git.py +++ b/libvcs/cmd/git.py @@ -10,7 +10,7 @@ class Git: - def __init__(self, dir: StrPath): + def __init__(self, *, dir: StrPath): """Lite, typed, pythonic wrapper for git(1). Parameters @@ -36,7 +36,7 @@ def __repr__(self): def run( self, args: _CMD, - /, + *, # Print-and-exit flags version: Optional[bool] = None, help: Optional[bool] = None, @@ -185,6 +185,7 @@ def run( def clone( self, + *, url: str, separate_git_dir: Optional[StrOrBytesPath] = None, template: Optional[str] = None, @@ -312,6 +313,7 @@ def clone( def fetch( self, + *, reftag: Optional[Any] = None, deepen: Optional[str] = None, depth: Optional[str] = None, @@ -469,6 +471,7 @@ def fetch( def rebase( self, + *, upstream: Optional[str] = None, onto: Optional[str] = None, branch: Optional[str] = None, @@ -665,6 +668,7 @@ def rebase( def pull( self, + *, reftag: Optional[Any] = None, repository: Optional[str] = None, deepen: Optional[str] = None, @@ -943,6 +947,7 @@ def pull( def init( self, + *, template: Optional[str] = None, separate_git_dir: Optional[StrOrBytesPath] = None, object_format: Optional[Literal["sha1", "sha256"]] = None, @@ -1022,6 +1027,7 @@ def init( def help( self, + *, all: Optional[bool] = None, verbose: Optional[bool] = None, no_external_commands: Optional[bool] = None, @@ -1105,6 +1111,7 @@ def help( def reset( self, + *, quiet: Optional[bool] = None, refresh: Optional[bool] = None, no_refresh: Optional[bool] = None, @@ -1196,6 +1203,7 @@ def reset( def checkout( self, + *, quiet: Optional[bool] = None, progress: Optional[bool] = None, no_progress: Optional[bool] = None, @@ -1329,6 +1337,7 @@ def checkout( def status( self, + *, verbose: Optional[bool] = None, long: Optional[bool] = None, short: Optional[bool] = None, @@ -1456,6 +1465,7 @@ def status( def config( self, + *, replace_all: Optional[bool] = None, get: Optional[str] = None, get_all: Optional[bool] = None, diff --git a/libvcs/cmd/hg.py b/libvcs/cmd/hg.py index c2df2b940..e239bf500 100644 --- a/libvcs/cmd/hg.py +++ b/libvcs/cmd/hg.py @@ -25,7 +25,7 @@ class HgPagerType(enum.Enum): class Hg: - def __init__(self, dir: StrPath): + def __init__(self, *, dir: StrPath): """Lite, typed, pythonic wrapper for hg(1). Parameters @@ -51,6 +51,7 @@ def __repr__(self): def run( self, args: _CMD, + *, config: Optional[str] = None, repository: Optional[str] = None, quiet: Optional[bool] = None, @@ -161,6 +162,7 @@ def run( def clone( self, + *, url: str, no_update: Optional[str] = None, update_rev: Optional[str] = None, diff --git a/libvcs/cmd/svn.py b/libvcs/cmd/svn.py index ea9a0c15a..c870495db 100644 --- a/libvcs/cmd/svn.py +++ b/libvcs/cmd/svn.py @@ -12,7 +12,7 @@ class Svn: - def __init__(self, dir: StrPath): + def __init__(self, *, dir: StrPath): """Lite, typed, pythonic wrapper for svn(1). Parameters @@ -38,6 +38,7 @@ def __repr__(self): def run( self, args: _CMD, + *, quiet: Optional[bool] = None, username: Optional[str] = None, password: Optional[str] = None, @@ -112,6 +113,7 @@ def run( def checkout( self, + *, url: str, revision: Union[RevisionLiteral, str] = None, force: Optional[bool] = None, @@ -159,6 +161,7 @@ def checkout( def add( self, + *, path: Union[list[pathlib.Path], pathlib.Path], targets: Optional[pathlib.Path] = None, depth: DepthLiteral = None, @@ -225,7 +228,6 @@ def auth( self, remove: Optional[str] = None, show_passwords: Optional[bool] = None, - *args, **kwargs, ): """ @@ -244,7 +246,7 @@ def auth( >>> Svn(dir=tmp_path).auth() "Credentials cache in '...' is empty" """ - local_flags: list[str] = [*args] + local_flags: list[str] = [] if remove is not None: local_flags.extend(["--remove", remove]) @@ -256,6 +258,7 @@ def auth( def blame( self, target: pathlib.Path, + *, revision: Union[RevisionLiteral, str] = None, verbose: Optional[bool] = None, force: Optional[bool] = None, @@ -263,7 +266,6 @@ def blame( incremental: Optional[bool] = None, xml: Optional[bool] = None, extensions: Optional[str] = None, - *args, **kwargs, ): """ @@ -304,7 +306,7 @@ def blame( >>> svn.blame('new.txt') '1 ... example text' """ - local_flags: list[str] = [target, *args] + local_flags: list[str] = [str(target)] if revision is not None: local_flags.append(f"--revision={revision}") @@ -361,6 +363,7 @@ def cleanup(self, *args, **kwargs): def commit( self, + *, path: Union[list[pathlib.Path], pathlib.Path], targets: Optional[pathlib.Path] = None, message: Optional[str] = None, @@ -371,7 +374,6 @@ def commit( force_log: Optional[bool] = None, keep_changelists: Optional[bool] = None, include_externals: Optional[bool] = None, - *args, **kwargs, ): """