-
Notifications
You must be signed in to change notification settings - Fork 36
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
add support for F# projects and use optimized directory traversals #48
Conversation
@@ -8,7 +8,7 @@ namespace CentralisedPackageConverter; | |||
public static class Output | |||
{ | |||
public static void InfoLine(string message) => InfoLine(message, Array.Empty<object>()); | |||
public static void InfoLine(string message, params object[] args) => AnsiConsole.MarkupLine(Markup.Escape(message), args); | |||
public static void InfoLine(string message, params object[] args) => AnsiConsole.MarkupLine(message, args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was required because the [green](project file path[/]
markup wasn't being rendered.
if (condition != String.Empty) | ||
{ | ||
Output.InfoLine(" Found new reference: {0} {1} with Condition {2}", | ||
package, version.ToFullString(), condition); | ||
} | ||
else | ||
{ | ||
Output.InfoLine(" Found new reference: {0} {1}", | ||
package, version.ToFullString()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did some simple if/elses here to remove dangling string formats for cases where there were no conditions.
return new FileSystemEnumerable<FileInfo>( | ||
directory: directory.FullName, | ||
transform: (ref FileSystemEntry entry) => new FileInfo(entry.ToFullPath()), | ||
options: new EnumerationOptions { RecurseSubdirectories = searchOption == SearchOption.AllDirectories } | ||
) | ||
{ | ||
ShouldIncludePredicate = (ref FileSystemEntry entry) => | ||
{ | ||
return !entry.IsDirectory && AllowedFileExtensions.Contains(Path.GetExtension(entry.FileName).ToString()); | ||
}, | ||
ShouldRecursePredicate = (ref FileSystemEntry entry) => | ||
{ | ||
return !ExcludesRegex.IsMatch(entry.FileName); | ||
}, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type is hyper-optimized and the existing traversal tests still pass after the change.
Merged - thank you for your contribution! :) |
Hi! This implements support for F# projects as well as using some new modern .NET directory traversals to speed up the traversal that was happening before. I've tested this on my own F# projects and it works great!
Results: