From 96e33b5b567d36691fdfa1b036e5f9df0e0dd58d Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 6 Jan 2025 06:35:14 +0800 Subject: [PATCH] fix for local repo --- lib/modules/manager/pre-commit/extract.ts | 6 +++++- lib/modules/manager/pre-commit/types.ts | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/modules/manager/pre-commit/extract.ts b/lib/modules/manager/pre-commit/extract.ts index 67c46714d077df..6d042fd883da59 100644 --- a/lib/modules/manager/pre-commit/extract.ts +++ b/lib/modules/manager/pre-commit/extract.ts @@ -12,8 +12,8 @@ import { matchesPrecommitConfigHeuristic, matchesPrecommitDependencyHeuristic, } from './parsing'; -import type { PreCommitConfig } from './types'; import { pep508ToPackageDependency } from '../pep621/utils'; +import type { PreCommitConfig } from './types'; /** * Determines the datasource(id) to be used for this dependency @@ -156,6 +156,10 @@ function findDependencies(precommitFile: PreCommitConfig): PackageDependency[] { }); }); precommitFile.repos.forEach((item) => { + if (!item.rev){ + return; + } + if (matchesPrecommitDependencyHeuristic(item)) { logger.trace(item, 'Matched pre-commit dependency spec'); const repository = String(item.repo); diff --git a/lib/modules/manager/pre-commit/types.ts b/lib/modules/manager/pre-commit/types.ts index 3d3b3cf2e12abc..31ed8e20f5761f 100644 --- a/lib/modules/manager/pre-commit/types.ts +++ b/lib/modules/manager/pre-commit/types.ts @@ -10,5 +10,5 @@ export interface PreCommitHook { export interface PreCommitDependency { repo: string; hooks?: Array; - rev: string; + rev?: string; }