-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: enhance commit command with path filtering and prefix handling
- Adds path filtering to the commit command, allowing users to specify which files to include in the diff - Introduces default exclusion patterns to ignore lock files and other non-essential files - Ensures that generated commit messages always start with a specified prefix
- Loading branch information
Showing
3 changed files
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
import asyncio | ||
from typing import Annotated | ||
|
||
import typer | ||
|
||
app = typer.Typer(name="commit") | ||
|
||
|
||
@app.command() | ||
def main() -> None: | ||
def main( | ||
path: Annotated[list[str] | None, typer.Argument()] = None, | ||
*, | ||
default_exclude: Annotated[bool, typer.Option()] = True, | ||
verify: Annotated[bool, typer.Option()] = True, | ||
) -> None: | ||
from ._main import main | ||
|
||
asyncio.run(main()) | ||
path: list[str] = path or [] | ||
if default_exclude: | ||
path += [":!*-lock.*", ":!*.lock*", ":!*.cspell.*"] | ||
asyncio.run(main(path, verify=verify)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters