Skip to content

Commit 02015bf

Browse files
authored
Fix bug where project files were being ignored as a trigger (#247)
1 parent ff8766e commit 02015bf

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

snippets5000/Snippets5000/Program.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static async Task<int> Main(string sourcepath, int? pullrequest = default, strin
5050
!string.IsNullOrEmpty(owner) &&
5151
!string.IsNullOrEmpty(repo))
5252
{
53-
IEnumerable<DiscoveryResult> projects;
53+
List<DiscoveryResult> projects;
5454

5555
// Normal github PR
5656
if (string.IsNullOrEmpty(dryrunTestId))
@@ -68,8 +68,9 @@ static async Task<int> Main(string sourcepath, int? pullrequest = default, strin
6868
else if (string.IsNullOrEmpty(dryrunTestDataFile))
6969
throw new ArgumentNullException(nameof(dryrunTestDataFile), "The dryrun Test DataFile must be set");
7070
else
71-
projects = new TestingProjectList(dryrunTestId, dryrunTestDataFile, sourcepath).GenerateBuildList();
71+
projects = new TestingProjectList(dryrunTestId, dryrunTestDataFile, sourcepath).GenerateBuildList().ToList();
7272

73+
Log.Write(0, $"{projects.Count} items found.");
7374
Log.Write(0, "\r\nOutput all items found, grouped by status...");
7475

7576
// Start processing all of the discovered projects
@@ -389,7 +390,6 @@ private static void ProcessFailedProjects(string repo, IEnumerable<SnippetsConfi
389390
{
390391
Log.Write(0, "");
391392
Log.Write(0, $"Found error code: {item.ErrorCode} on line\r\n{Log.Ind(4)}{item.ErrorLine!}");
392-
393393
Match match = Regex.Match(item.ErrorLine!, "(^.*)\\((\\d*),(\\d*)\\)");
394394

395395
if (match.Success)

snippets5000/Snippets5000/Properties/launchSettings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"profiles": {
33
"Test via GitHub": {
44
"commandName": "Project",
5-
"commandLineArgs": "--sourcepath C:\\\\code\\\\Work\\\\dotnet\\\\docs-desktop --owner dotnet --repo docs-desktop --pullrequest 1058",
5+
"commandLineArgs": "--sourcepath C:\\code\\Work\\dotnet\\dotnet-api-docs --owner dotnet --repo dotnet-api-docs --pullrequest 9149",
66
"environmentVariables": {
77
"ExtensionsProjs": ".csproj;.fsproj;.vbproj;.vcxproj;.sln",
88
"ExtensionsCodeTriggers": ".cs;.vb;.fs;.cpp;.h;.xaml;.razor;.cshtml;.vbhtml",

snippets5000/Snippets5000/PullRequestProcessor.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ private async IAsyncEnumerable<DiscoveryResult> FindAllSolutionsAndProjects(stri
7676

7777
// The file must be in the list of file name triggers or its extension must be one we care about
7878
if (!EnvFileTriggers.Contains(itemFileName, StringComparer.OrdinalIgnoreCase) &&
79-
!EnvExtensionsCodeTriggers.Contains(Path.GetExtension(itemFileName), StringComparer.OrdinalIgnoreCase))
79+
!EnvExtensionsCodeTriggers.Contains(Path.GetExtension(itemFileName), StringComparer.OrdinalIgnoreCase) &&
80+
!EnvExtensionsProjects.Contains(Path.GetExtension(itemFileName), StringComparer.OrdinalIgnoreCase))
8081
return null;
8182

8283
bool itemWasDeleted = !File.Exists(fullPath);

snippets5000/Snippets5000/Snippets5000.csproj

+2-7
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@
77
<Nullable>enable</Nullable>
88

99
<Version>4.0.0.0</Version>
10-
11-
<PackAsTool>true</PackAsTool>
12-
<ToolCommandName>snippets5000</ToolCommandName>
13-
<PackageOutputPath>./nupkg</PackageOutputPath>
14-
15-
<PackageId>DotnetDocsTools.LocateProjects</PackageId>
16-
<Authors>Andy and Bill</Authors>
10+
<AssemblyTitle>Snippets 5000</AssemblyTitle>
11+
<Authors>Andy De George</Authors>
1712
<Company>Microsoft</Company>
1813
</PropertyGroup>
1914

0 commit comments

Comments
 (0)