You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using System.Text.Json;
namespace Microsoft.Azure.HybridCompute.Shared.DataModel.Entities.NetworkSecurityPerimeter;
public class NSPValidationData
{
public NSPValidationData()
{
var accessRulesResponsePayload = new Dictionary<string, List<int>? >
{
{ "value", accessRulesResponseModel } // NSP data plane library expects this format
};
}
}
Command line Output:
> dotnet csharpier test.cs
Error ./test.cs - Failed syntax tree validation.
----------------------------- Original: Around Line 10 -----------------------------
var accessRulesResponsePayload = new Dictionary<string, List<int>? >
{
{ "value", accessRulesResponseModel } // NSP data plane library expects this format
};
}
}
----------------------------- Formatted: Around Line 0 -----------------------------
using System.Text.Json;
namespace Microsoft.Azure.HybridCompute.Shared.DataModel.Entities.NetworkSecurityPerimeter;
public class NSPValidationData
{
public NSPValidationData()
{
Formatted 1 files in 213ms.
file output
using System.Text.Json;
namespace Microsoft.Azure.HybridCompute.Shared.DataModel.Entities.NetworkSecurityPerimeter;
public class NSPValidationData
{
public NSPValidationData()
{
var accessRulesResponsePayload = new Dictionary<string, List<int>?>
{
{ "value", accessRulesResponseModel }, // NSP data plane library expects this format
};
}
}
Expected behavior:
There doesn't seem to be an issue with the syntax tree, so I don't expect to see an error reported.
If I remove the comment, and change the input to the file below, I don't see any error.
using System.Text.Json;
namespace Microsoft.Azure.HybridCompute.Shared.DataModel.Entities.NetworkSecurityPerimeter;
public class NSPValidationData
{
public NSPValidationData()
{
var accessRulesResponsePayload = new Dictionary<string, List<int>? >
{
{ "value", accessRulesResponseModel }
};
}
}
The text was updated successfully, but these errors were encountered:
The syntax tree validation logic doesn't account for the edge case I fixed in 0.30.0 where the trailing comma needs to be added before the trailing comment. I'm hoping this will be a quick fix that I can get out today, but if not it is safe to ignore. It'll only fail the validation when it first adds the comma.
Csharpier version 0.30.1
Input:
Command line Output:
file output
Expected behavior:
There doesn't seem to be an issue with the syntax tree, so I don't expect to see an error reported.
If I remove the comment, and change the input to the file below, I don't see any error.
The text was updated successfully, but these errors were encountered: