Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.checkmarx.eclipse.devassist.utils;

import java.util.Arrays;
import java.util.List;

import com.checkmarx.eclipse.common.utils.CxLogger;
Expand Down Expand Up @@ -144,9 +145,9 @@ public static List<String> getCompanionFileNames(String fileName) {
return getCompanionFileNamesByType(CompanionFileType.COMPOSER_LOCK);
}

// Python Poetry
// Python Poetry or UV
if (fileName.equals("pyproject.toml")) {
return getCompanionFileNamesByType(CompanionFileType.POETRY_LOCK);
return getCompanionFileNamesByType(CompanionFileType.POETRY_LOCK, CompanionFileType.UV_LOCK);
}

// Dart/Flutter Pub
Expand All @@ -170,6 +171,7 @@ static enum CompanionFileType {
GEMFILE_LOCK("Gemfile.lock"),
COMPOSER_LOCK("composer.lock"),
POETRY_LOCK("poetry.lock"),
UV_LOCK("uv.lock"),
PUBSPEC_LOCK("pubspec.lock");

private String compFileName;
Expand All @@ -183,11 +185,12 @@ public String getCompFileName() {
}
}

public static List<String> getCompanionFileNamesByType(CompanionFileType type) {
if (type == null) {
public static List<String> getCompanionFileNamesByType(CompanionFileType... type) {
if (type == null || type.length == 0) {
return List.of();
}
return List.of(type.getCompFileName());
return Arrays.stream(type).filter(fileType -> fileType != null)
.map(CompanionFileType::getCompFileName).toList();
}

/**
Expand Down
Loading