-
-
Notifications
You must be signed in to change notification settings - Fork 961
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
Escape the build arguments containing backslash #1593
Conversation
|
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.
Big thanks for your PR!
Overall it looks good, but please address the comments that I've added before I merge the PR.
Thanks,
Adam
src/BenchmarkDotNet/Jobs/Argument.cs
Outdated
/// <param name="args"></param> | ||
/// <returns></returns> |
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.
nit: we try to avoid empty descriptions, so this can be just removed
/// <param name="args"></param> | |
/// <returns></returns> |
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.
Removed the description from the documentation section
src/BenchmarkDotNet/Jobs/Argument.cs
Outdated
/// </summary> | ||
/// <param name="args"></param> | ||
/// <returns></returns> | ||
public string EscapeBuildArguments(string 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.
could you please make this method internal and add some simple unit test for it?
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.
Marked the method as internal instead of public
/// <returns></returns> | ||
public string EscapeBuildArguments(string args) | ||
{ | ||
if (args.Contains("\\")) |
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.
we should also consider the case where the user provides an already escaped characters like new MsBuildArgument("/p:a=b\\\\"
) and to be 100% complete a version when there is a mix like ("/p:\a=b\\\\"
)`
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.
Added unit test cases to cover the scenarios as suggested
Added unit test cases for escaping MSBuildArguments
@adamsitnik |
@adamsitnik could you please review the PR? |
Fixes the following issue with passing build arguments
System.FormatException in AfterAssemblyLoadingAttached