Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ repos:
additional_dependencies:
- "mvdan.cc/sh/v3/cmd/shfmt@v3.13.1"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.22
rev: v0.16.1
hooks:
- id: ruff-check
args: [--fix]
Expand Down
7 changes: 4 additions & 3 deletions scripts/sync_go_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ def find_module_version(dep_path: str, modules: dict[str, str]) -> str | None:
"""Find the version for the longest module path that is a prefix of dep_path."""
best_mod: str | None = None
for mod in modules:
if dep_path == mod or dep_path.startswith(mod + "/"):
if best_mod is None or len(mod) > len(best_mod):
best_mod = mod
if (dep_path == mod or dep_path.startswith(mod + "/")) and (
best_mod is None or len(mod) > len(best_mod)
):
best_mod = mod
return modules[best_mod] if best_mod is not None else None


Expand Down
Loading