Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit aa9971e

Browse files
committed
feat(commands/init): detect if "uv.lock" existsin the project. if so set the default scheme to pep440
1 parent 1fa1b7c commit aa9971e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎commitizen/commands/init.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ def has_setup(self) -> bool:
3232
def has_pre_commit_config(self) -> bool:
3333
return os.path.isfile(".pre-commit-config.yaml")
3434

35+
@property
36+
def has_uv_lock(self) -> bool:
37+
return os.path.isfile("uv.lock")
38+
3539
@property
3640
def is_python_poetry(self) -> bool:
3741
if not self.has_pyproject:
@@ -260,7 +264,7 @@ def _ask_version_provider(self) -> str:
260264
def _ask_version_scheme(self) -> str:
261265
"""Ask for setting: version_scheme"""
262266
default = "semver"
263-
if self.project_info.is_python:
267+
if self.project_info.is_pythonorself.project_info.has_uv_lock:
264268
default = "pep440"
265269

266270
scheme: str = questionary.select(

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /