Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where project files were being ignored as a trigger #247

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions snippets5000/Snippets5000/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static async Task<int> Main(string sourcepath, int? pullrequest = default, strin
!string.IsNullOrEmpty(owner) &&
!string.IsNullOrEmpty(repo))
{
IEnumerable<DiscoveryResult> projects;
List<DiscoveryResult> projects;

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

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

// Start processing all of the discovered projects
Expand Down Expand Up @@ -389,7 +390,6 @@ private static void ProcessFailedProjects(string repo, IEnumerable<SnippetsConfi
{
Log.Write(0, "");
Log.Write(0, $"Found error code: {item.ErrorCode} on line\r\n{Log.Ind(4)}{item.ErrorLine!}");

Match match = Regex.Match(item.ErrorLine!, "(^.*)\\((\\d*),(\\d*)\\)");

if (match.Success)
Expand Down
2 changes: 1 addition & 1 deletion snippets5000/Snippets5000/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"Test via GitHub": {
"commandName": "Project",
"commandLineArgs": "--sourcepath C:\\\\code\\\\Work\\\\dotnet\\\\docs-desktop --owner dotnet --repo docs-desktop --pullrequest 1058",
"commandLineArgs": "--sourcepath C:\\code\\Work\\dotnet\\dotnet-api-docs --owner dotnet --repo dotnet-api-docs --pullrequest 9149",
"environmentVariables": {
"ExtensionsProjs": ".csproj;.fsproj;.vbproj;.vcxproj;.sln",
"ExtensionsCodeTriggers": ".cs;.vb;.fs;.cpp;.h;.xaml;.razor;.cshtml;.vbhtml",
Expand Down
3 changes: 2 additions & 1 deletion snippets5000/Snippets5000/PullRequestProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ private async IAsyncEnumerable<DiscoveryResult> FindAllSolutionsAndProjects(stri

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

bool itemWasDeleted = !File.Exists(fullPath);
Expand Down
9 changes: 2 additions & 7 deletions snippets5000/Snippets5000/Snippets5000.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@
<Nullable>enable</Nullable>

<Version>4.0.0.0</Version>

<PackAsTool>true</PackAsTool>
<ToolCommandName>snippets5000</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>

<PackageId>DotnetDocsTools.LocateProjects</PackageId>
<Authors>Andy and Bill</Authors>
<AssemblyTitle>Snippets 5000</AssemblyTitle>
<Authors>Andy De George</Authors>
<Company>Microsoft</Company>
</PropertyGroup>

Expand Down
Loading