Skip to content

Commit

Permalink
Shorten rule name to avoid "path name to long" test breaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Larry Golding committed Jul 11, 2019
1 parent 64120ea commit c90577d
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/Sarif.Multitool/Rules/RuleId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ public static class RuleId
public const string UriBaseIdRequiresRelativeUri = "SARIF1014";
public const string UriMustBeAbsolute = "SARIF1015";
public const string ContextRegionRequiresRegion = "SARIF1016";
public const string LogicalLocationIndexRequiresRunLogicalLocation = "SARIF1017";
public const string InvalidLogicalLocationIndex = "SARIF1017";
}
}
4 changes: 2 additions & 2 deletions src/Sarif.Multitool/Rules/RuleResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Sarif.Multitool/Rules/RuleResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
<data name="SARIF1017_Default" xml:space="preserve">
<value>{0}: This "logicalLocation" object contains an "index" property with value {1}, but either "run.LogicalLocations" is absent, or it has fewer than {2} elements.</value>
</data>
<data name="SARIF1017_LogicalLocationIndexRequiresRunLogicalLocation" xml:space="preserve">
<data name="SARIF1017_InvalidLogicalLocationIndex" xml:space="preserve">
<value>If a "logicalLocation" object contains an "index" property, then "run.logicalLocations" must be present and must contain at least "index + 1" elements.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

namespace Microsoft.CodeAnalysis.Sarif.Multitool.Rules
{
public class LogicalLocationIndexRequiresRunLogicalLocation : SarifValidationSkimmerBase
public class InvalidLogicalLocationIndex : SarifValidationSkimmerBase
{
private readonly MultiformatMessageString _fullDescription = new MultiformatMessageString
{
Text = RuleResources.SARIF1017_LogicalLocationIndexRequiresRunLogicalLocation
Text = RuleResources.SARIF1017_InvalidLogicalLocationIndex
};

public override MultiformatMessageString FullDescription => _fullDescription;
Expand All @@ -19,7 +19,7 @@ public class LogicalLocationIndexRequiresRunLogicalLocation : SarifValidationSki
/// <summary>
/// SARIF1017
/// </summary>
public override string Id => RuleId.LogicalLocationIndexRequiresRunLogicalLocation;
public override string Id => RuleId.InvalidLogicalLocationIndex;

protected override IEnumerable<string> MessageResourceNames => new string[]
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ public void SARIF1016_ContextRegionRequiresRegion_Invalid()
=> RunTest(RuleId.ContextRegionRequiresRegion + "." + nameof(RuleId.ContextRegionRequiresRegion) + "_Invalid.sarif");

[Fact]
public void SARIF1017_LogicalLocationIndexRequiresRunLogicalLocation_Valid()
=> RunTest(RuleId.LogicalLocationIndexRequiresRunLogicalLocation + "." + nameof(RuleId.LogicalLocationIndexRequiresRunLogicalLocation) + "_Valid.sarif");
public void SARIF1017_InvalidLogicalLocationIndex_Valid()
=> RunTest(RuleId.InvalidLogicalLocationIndex + "." + nameof(RuleId.InvalidLogicalLocationIndex) + "_Valid.sarif");

[Fact]
public void SARIF1017_LogicalLocationIndexRequiresRunLogicalLocation_Invalid()
=> RunTest(RuleId.LogicalLocationIndexRequiresRunLogicalLocation + "." + nameof(RuleId.LogicalLocationIndexRequiresRunLogicalLocation) + "_Invalid.sarif");
public void SARIF1017_InvalidLogicalLocationIndex_Invalid()
=> RunTest(RuleId.InvalidLogicalLocationIndex + "." + nameof(RuleId.InvalidLogicalLocationIndex) + "_Invalid.sarif");

protected override string ConstructTestOutputFromInputResource(string inputResourceName)
{
Expand Down
16 changes: 8 additions & 8 deletions src/Test.FunctionalTests.Sarif/Test.FunctionalTests.Sarif.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
<None Remove="TestData\Multitool\ValidateCommand\ExpectedOutputs\SARIF1015.UriMustBeAbsolute_Valid.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\ExpectedOutputs\SARIF1016.ContextRegionRequiresRegion_Invalid.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\ExpectedOutputs\SARIF1016.ContextRegionRequiresRegion_Valid.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\ExpectedOutputs\SARIF1017.LogicalLocationIndexRequiresRunLogicalLocation_Invalid.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\ExpectedOutputs\SARIF1017.LogicalLocationIndexRequiresRunLogicalLocation_Valid.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\ExpectedOutputs\SARIF1017.InvalidLogicalLocationIndex_Invalid.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\ExpectedOutputs\SARIF1017.InvalidLogicalLocationIndex_Valid.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\Inputs\JSON1001.SyntaxError.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\Inputs\JSON1002.DeserializationError.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\Inputs\SARIF1001.DoNotUseFriendlyNameAsRuleId_Invalid.sarif" />
Expand All @@ -78,8 +78,8 @@
<None Remove="TestData\Multitool\ValidateCommand\Inputs\SARIF1015.UriMustBeAbsolute_Valid.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\Inputs\SARIF1016.ContextRegionRequiresRegion_Invalid.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\Inputs\SARIF1016.ContextRegionRequiresRegion_Valid.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\Inputs\SARIF1017.LogicalLocationIndexRequiresRunLogicalLocation_Invalid.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\Inputs\SARIF1017.LogicalLocationIndexRequiresRunLogicalLocation_Valid.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\Inputs\SARIF1017.InvalidLogicalLocation_Invalid.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\Inputs\SARIF1017.InvalidLogicalLocation_Valid.sarif" />
<None Remove="TestData\Multitool\ValidateCommand\Inputs\SimpleExample.sarif-external-properties.json" />
</ItemGroup>

Expand Down Expand Up @@ -3046,8 +3046,8 @@
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\ExpectedOutputs\SARIF1015.UriMustBeAbsolute_Valid.sarif" />
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\ExpectedOutputs\SARIF1016.ContextRegionRequiresRegion_Invalid.sarif" />
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\ExpectedOutputs\SARIF1016.ContextRegionRequiresRegion_Valid.sarif" />
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\ExpectedOutputs\SARIF1017.LogicalLocationIndexRequiresRunLogicalLocation_Invalid.sarif" />
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\ExpectedOutputs\SARIF1017.LogicalLocationIndexRequiresRunLogicalLocation_Valid.sarif" />
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\ExpectedOutputs\SARIF1017.InvalidLogicalLocationIndex_Invalid.sarif" />
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\ExpectedOutputs\SARIF1017.InvalidLogicalLocationIndex_Valid.sarif" />
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\Inputs\JSON1001.SyntaxError.sarif" />
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\Inputs\JSON1002.DeserializationError.sarif" />
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\Inputs\SARIF1001.DoNotUseFriendlyNameAsRuleId_Invalid.sarif" />
Expand All @@ -3069,8 +3069,8 @@
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\Inputs\SARIF1016.ContextRegionRequiresRegion_Invalid.sarif" />
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\Inputs\SARIF1016.ContextRegionRequiresRegion_Valid.sarif" />
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\Inputs\SimpleExample.sarif-external-properties.json" />
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\Inputs\SARIF1017.LogicalLocationIndexRequiresRunLogicalLocation_Invalid.sarif" />
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\Inputs\SARIF1017.LogicalLocationIndexRequiresRunLogicalLocation_Valid.sarif" />
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\Inputs\SARIF1017.InvalidLogicalLocationIndex_Invalid.sarif" />
<EmbeddedResource Include="TestData\Multitool\ValidateCommand\Inputs\SARIF1017.InvalidLogicalLocationIndex_Valid.sarif" />
<None Include="v2\ConverterTestData\PREfast\Expected-001.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"rules": [
{
"id": "SARIF1017",
"name": "LogicalLocationIndexRequiresRunLogicalLocation",
"name": "InvalidLogicalLocationIndex",
"shortDescription": {
"text": "If a \"logicalLocation\" object contains an \"index\" property, then \"run."
},
Expand All @@ -34,14 +34,14 @@
{
"physicalLocation": {
"artifactLocation": {
"uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1017.LogicalLocationIndexRequiresRunLogicalLocation_Invalid.sarif",
"uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1017.InvalidLogicalLocationIndex_Invalid.sarif",
"uriBaseId": "TEST_DIR"
}
}
}
],
"message": {
"text": "Analyzing 'Inputs.SARIF1017.LogicalLocationIndexRequiresRunLogicalLocation_Invalid.sarif'..."
"text": "Analyzing 'Inputs.SARIF1017.InvalidLogicalLocationIndex_Invalid.sarif'..."
},
"level": "none",
"descriptor": {
Expand All @@ -55,7 +55,7 @@
"artifacts": [
{
"location": {
"uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1017.LogicalLocationIndexRequiresRunLogicalLocation_Invalid.sarif",
"uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1017.InvalidLogicalLocationIndex_Invalid.sarif",
"uriBaseId": "TEST_DIR",
"index": 0
},
Expand All @@ -79,7 +79,7 @@
{
"physicalLocation": {
"artifactLocation": {
"uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1017.LogicalLocationIndexRequiresRunLogicalLocation_Invalid.sarif",
"uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1017.InvalidLogicalLocationIndex_Invalid.sarif",
"uriBaseId": "TEST_DIR",
"index": 0
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
{
"physicalLocation": {
"artifactLocation": {
"uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1017.LogicalLocationIndexRequiresRunLogicalLocation_Valid.sarif",
"uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1017.InvalidLogicalLocationIndex_Valid.sarif",
"uriBaseId": "TEST_DIR"
}
}
}
],
"message": {
"text": "Analyzing 'Inputs.SARIF1017.LogicalLocationIndexRequiresRunLogicalLocation_Valid.sarif'..."
"text": "Analyzing 'Inputs.SARIF1017.InvalidLogicalLocationIndex_Valid.sarif'..."
},
"level": "none",
"descriptor": {
Expand All @@ -37,7 +37,7 @@
"artifacts": [
{
"location": {
"uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1017.LogicalLocationIndexRequiresRunLogicalLocation_Valid.sarif",
"uri": "FunctionalTestOutput.ValidateCommand/Inputs.SARIF1017.InvalidLogicalLocationIndex_Valid.sarif",
"uriBaseId": "TEST_DIR",
"index": 0
},
Expand Down

0 comments on commit c90577d

Please sign in to comment.