Skip to content

Commit 286bc03

Browse files
committed
Remove OnPrepareDetectionAsync method and related skipped folder logic from DockerfileComponentDetector
1 parent b44ed37 commit 286bc03

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

‎src/Microsoft.ComponentDetection.Detectors/dockerfile/DockerfileComponentDetector.cs‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ namespace Microsoft.ComponentDetection.Detectors.Dockerfile;
33
using System;
44
using System.Collections.Generic;
55
using System.IO;
6-
using System.Linq;
7-
using System.Reactive.Linq;
86
using System.Threading;
97
using System.Threading.Tasks;
108
using Microsoft.ComponentDetection.Common;
@@ -46,13 +44,6 @@ public DockerfileComponentDetector(
4644

4745
protected override IList<string> SkippedFolders => ["node_modules"];
4846

49-
protected override Task<IObservable<ProcessRequest>> OnPrepareDetectionAsync(
50-
IObservable<ProcessRequest> processRequests,
51-
IDictionary<string, string> detectorArgs,
52-
CancellationToken cancellationToken = default) =>
53-
Task.FromResult(processRequests.Where(processRequest =>
54-
!this.IsInSkippedFolder(processRequest.ComponentStream.Location)));
55-
5647
protected override async Task OnFileFoundAsync(ProcessRequest processRequest, IDictionary<string, string> detectorArgs, CancellationToken cancellationToken = default)
5748
{
5849
var singleFileComponentRecorder = processRequest.SingleFileComponentRecorder;
@@ -81,12 +72,6 @@ protected override async Task OnFileFoundAsync(ProcessRequest processRequest, ID
8172
}
8273
}
8374

84-
private bool IsInSkippedFolder(string filePath)
85-
{
86-
var pathSegments = filePath.Split(['/', '\\'], StringSplitOptions.RemoveEmptyEntries);
87-
return this.SkippedFolders.Any(skippedFolder => pathSegments.Contains(skippedFolder, StringComparer.OrdinalIgnoreCase));
88-
}
89-
9075
private Task ParseDockerFileAsync(string fileContents, string fileLocation, ISingleFileComponentRecorder singleFileComponentRecorder, Dictionary<string, string> stageNameMap)
9176
{
9277
var dockerfileModel = Dockerfile.Parse(fileContents);

0 commit comments

Comments
 (0)