Skip to content

Commit 609ecea

Browse files
authored
fix: removed rule because of which no files for underscore folder (#153)
1 parent 02c2fdd commit 609ecea

3 files changed

Lines changed: 35 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
## [1.1.15]
44

5+
### Fixed
6+
- Fixed a bug in Snyk Code where files with an underscore in the path would be ignored.
7+
- Restore all tree items after clear search or filter.
8+
59
### Changed
610
- Expand all scan results after completing a scan
711

8-
### Fixed
9-
- Restore all tree items after clear search or filter.
10-
1112
## [1.1.14]
1213

1314
### Fixed

Snyk.Code.Library.Tests/SnykCode/DcIgnoreServiceTest.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,5 +156,36 @@ public void DcIgnoreService_ListOfProjectFilesProvided_FilterFilesByGitIgnoreChe
156156

157157
Assert.Equal(4, filteredFiles.Count);
158158
}
159+
160+
[Fact]
161+
public void DcIgnoreService_FilePathWithUnderscoreFolderNameProvided_FilterFilesPass()
162+
{
163+
string folderPath = Path.GetTempPath();
164+
165+
string dcIGnorePath = Path.Combine(folderPath, ".dcignore");
166+
167+
if (File.Exists(dcIGnorePath))
168+
{
169+
File.Delete(dcIGnorePath);
170+
}
171+
172+
Assert.False(File.Exists(dcIGnorePath));
173+
174+
var projectFiles = new List<string>
175+
{
176+
"/Projects/_/Src/Main.cs",
177+
"/Projects/_/Src/App.cs",
178+
"/Projects/_/Src/Service/Service.cs",
179+
};
180+
181+
var dcIgnoreService = new DcIgnoreService();
182+
var filteredFiles = dcIgnoreService.FilterFiles(folderPath, projectFiles).ToList();
183+
184+
Assert.Equal(3, filteredFiles.Count);
185+
186+
Assert.True(File.Exists(dcIGnorePath));
187+
188+
File.Delete(dcIGnorePath);
189+
}
159190
}
160191
}

Snyk.Code.Library/Resources/full.dcignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,6 @@ DerivedData/
13401340
**/IntegrationServer/packages/Wm*/
13411341

13421342
# ModelSim
1343-
[_@]*
13441343
wlf*
13451344
cov*/
13461345
transcript*

0 commit comments

Comments
 (0)