Skip to content

Commit

Permalink
Merge branch 'main' into feature/pr-autoflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dependjinbot committed May 22, 2023
2 parents 8367c7d + a50d132 commit 8eba61c
Show file tree
Hide file tree
Showing 22 changed files with 151 additions and 125 deletions.
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ branches:
- feature
- support
- hotfix
next-version: "1.0"
next-version: "1.2"

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
<IsPackable>false</IsPackable>
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>

<!--
CA1822 - static all the things. Not helpful in benchmark projects where many things are invoked through invisible means.
-->
<NoWarn>$(NoWarn);CA1822</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand All @@ -18,9 +23,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.4" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.4" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.4">
<PackageReference Include="BenchmarkDotNet" Version="0.13.5" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.5" />
<PackageReference Include="Endjin.RecommendedPractices.GitHub" Version="2.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -32,8 +37,4 @@
<RestoreLockedMode Condition="$(ContinuousIntegrationBuild) == 'true'">true</RestoreLockedMode>
</PropertyGroup>

<ItemGroup>
<PackageReference Update="Roslynator.Analyzers" Version="4.2.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@ public void ExtractParametersTavis()
/// <summary>
/// Extract parameters from a URI template using the Corvus implementation of the Tavis API.
/// </summary>
/// <returns>
/// A result, to ensure that the code under test does not get optimized out of existence.
/// </returns>
[Benchmark]
public void ExtractParametersCorvusTavis()
public IDictionary<string, object>? ExtractParametersCorvusTavis()
{
IDictionary<string, object?>? result = this.corvusTavisTemplate!.GetParameters(TavisUri);
return this.corvusTavisTemplate!.GetParameters(TavisUri);
}

/// <summary>
Expand All @@ -83,7 +86,9 @@ public void ExtractParametersCorvusTavisWithParameterCache()
// We can't use the state
}

#pragma warning disable RCS1163 // Unused parameter.
static void HandleParameters(ReadOnlySpan<char> name, ReadOnlySpan<char> value, ref int state)
#pragma warning restore RCS1163 // Unused parameter.
{
state++;
}
Expand All @@ -98,7 +103,9 @@ public void ExtractParametersCorvus()
int state = 0;
this.corvusTemplate!.ParseUri(Uri, HandleParameterMatching, ref state);

#pragma warning disable RCS1163 // Unused parameter.
static void HandleParameterMatching(bool reset, ReadOnlySpan<char> name, ReadOnlySpan<char> value, ref int state)
#pragma warning restore RCS1163 // Unused parameter.
{
if (reset)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class UriTemplateParameterSetting
{
private const string UriTemplate = "http://example.org/location{?value*}";
private static readonly Dictionary<string, string> Value = new() { { "foo", "bar" }, { "bar", "baz" }, { "baz", "bob" } };
private static readonly Dictionary<string, object?> Parameters = new() { { "value", Value } };
private static readonly Dictionary<string, object?> InputParameters = new() { { "value", Value } };

private readonly JsonDocument jsonValues = JsonDocument.Parse("{\"value\": { \"foo\": \"bar\", \"bar\": \"baz\", \"baz\": \"bob\" }}");
private Tavis.UriTemplates.UriTemplate? tavisTemplate;
Expand Down Expand Up @@ -72,7 +72,9 @@ public void ResolveUriCorvusJson()
{
object? nullState = default;
JsonUriTemplateResolver.TryResolveResult(UriTemplate.AsSpan(), false, this.jsonValues.RootElement, HandleResult, ref nullState);
#pragma warning disable RCS1163 // Unused parameter.
static void HandleResult(ReadOnlySpan<char> resolvedTemplate, ref object? state)
#pragma warning restore RCS1163 // Unused parameter.
{
// NOP
}
Expand All @@ -85,8 +87,10 @@ static void HandleResult(ReadOnlySpan<char> resolvedTemplate, ref object? state)
public void ResolveUriCorvusDictionary()
{
object? nullState = default;
DictionaryUriTemplateResolver.TryResolveResult(UriTemplate.AsSpan(), false, Parameters, HandleResult, ref nullState);
DictionaryUriTemplateResolver.TryResolveResult(UriTemplate.AsSpan(), false, InputParameters, HandleResult, ref nullState);
#pragma warning disable RCS1163 // Unused parameter.
static void HandleResult(ReadOnlySpan<char> resolvedTemplate, ref object? state)
#pragma warning restore RCS1163 // Unused parameter.
{
// NOP
}
Expand Down
110 changes: 58 additions & 52 deletions Solutions/Corvus.UriTemplate.Benchmarking/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,47 @@
"net7.0": {
"BenchmarkDotNet": {
"type": "Direct",
"requested": "[0.13.2, )",
"resolved": "0.13.2",
"contentHash": "82IflYxY8qnQXEA3kXtqC9pntrkJYJZbQ9PV7hEV/XcfCtOdwLz84ilyO8tLRVbiliWttvmt/v44P+visN+fPQ==",
"requested": "[0.13.5, )",
"resolved": "0.13.5",
"contentHash": "PiwINqvreKV7L+BQlaZ2qcJ90s88LbLqZoUWbKnEPzvmsWd4pUH58Yjp+mFn311n8Jz0Y0JsD+jWa+Kh67IG3A==",
"dependencies": {
"BenchmarkDotNet.Annotations": "0.13.2",
"BenchmarkDotNet.Annotations": "0.13.5",
"CommandLineParser": "2.4.3",
"Gee.External.Capstone": "2.3.0",
"Iced": "1.17.0",
"Microsoft.CodeAnalysis.CSharp": "3.0.0",
"Microsoft.Diagnostics.Runtime": "2.2.332302",
"Microsoft.Diagnostics.Tracing.TraceEvent": "3.0.2",
"Microsoft.DotNet.PlatformAbstractions": "3.1.6",
"Perfolizer": "0.2.1",
"System.Management": "6.0.0",
"System.Reflection.Emit": "4.7.0",
"System.Reflection.Emit.Lightweight": "4.7.0",
"System.Threading.Tasks.Extensions": "4.5.4"
"System.Management": "6.0.0"
}
},
"BenchmarkDotNet.Diagnostics.Windows": {
"type": "Direct",
"requested": "[0.13.2, )",
"resolved": "0.13.2",
"contentHash": "COcdJcVt036U8cYHyHhq5ymI24AoV5h5BKHBzl5fbY0PUWF32immWWnSd66taOJRoe0Fr5ikimHNBVNXgV3KqA==",
"requested": "[0.13.5, )",
"resolved": "0.13.5",
"contentHash": "bNKJlIgUvEMBotiiHrEzw2xyCFlNiEfE14/EcBOEDSgYg+spzByVVv+totq9baxKUk5MhfAFhyzguBMiuoho3Q==",
"dependencies": {
"BenchmarkDotNet": "0.13.2",
"BenchmarkDotNet": "0.13.5",
"Microsoft.Diagnostics.Tracing.TraceEvent": "3.0.2"
}
},
"Endjin.RecommendedPractices.GitHub": {
"type": "Direct",
"requested": "[2.1.2, )",
"resolved": "2.1.2",
"contentHash": "mBUCmeSdWWrIQKuuYd9zflcwupRDmpF39dsbb07e6azlNIQqaE1J5TQa17c3SFVRXn9IZrClsmKoMporRTAWwQ==",
"requested": "[2.1.5, )",
"resolved": "2.1.5",
"contentHash": "PoZqxrp7iYbSF0Vi2Wtj2sepxwZA3i4Yq9CGueralFhLYcHE60E3bQOwHLwWsv4oNf60FYJrr3RjFPa7pv1HyA==",
"dependencies": {
"Endjin.RecommendedPractices": "2.1.2",
"Endjin.RecommendedPractices": "2.1.5",
"Microsoft.SourceLink.GitHub": "1.1.1"
}
},
"Roslynator.Analyzers": {
"type": "Direct",
"requested": "[4.1.1, )",
"resolved": "4.1.1",
"contentHash": "3cPVlrB1PytlO1ztZZBOExDKQWpMZgI15ZDa0BqLu0l6xv+xIRfEpqjNRcpvUy3aLxWTkPgSKZbbaO+VoFEJ1g=="
"requested": "[4.3.0, )",
"resolved": "4.3.0",
"contentHash": "NZNaV9DAYGHKZ753WfhtBj8eoP40LLJsA6JQXdzhF87iTZAdbKCgp32mI3cnQF4TMXz7bk+CgzF/kDG+m+9bCg=="
},
"StyleCop.Analyzers": {
"type": "Direct",
Expand All @@ -68,8 +66,8 @@
},
"BenchmarkDotNet.Annotations": {
"type": "Transitive",
"resolved": "0.13.2",
"contentHash": "+SGOYyXT6fiagbtrni38B8BqBgjruYKU3PfROI0lDIYo8jQ+APUmLKMEswK7zwR5fEOCrDmoAHSH6oykBkqPgA=="
"resolved": "0.13.5",
"contentHash": "ORcRi9/fnjRfINKiAnAgIsRlQ15Gj2Lki7AluHnAVMk/lTyQ2nwaa+F+ezW8f3tElBDoZql02+J2lIwHbu1eoA=="
},
"CommandLineParser": {
"type": "Transitive",
Expand All @@ -78,17 +76,22 @@
},
"CommunityToolkit.HighPerformance": {
"type": "Transitive",
"resolved": "8.0.0",
"contentHash": "S5Iv1d5UJZNJLJbe/xzJmLqYJ2mhefbLAvhXCZEh3G4sFadUBuQZhQioE4oJG4enY69QMuJX3AX9+6P9rH1bMw=="
"resolved": "8.2.0",
"contentHash": "iKzsPiSnXoQUN5AoApYmdfnLn9osNb+YCLWRr5PFmrDEQVIu7OeOyf4DPvNBvbqbYLZCfvHozPkulyv6zBQsFw=="
},
"Endjin.RecommendedPractices": {
"type": "Transitive",
"resolved": "2.1.2",
"contentHash": "Nbj0WS3zVDD2wjfU2/nbkWIWS9Ljg8VN+SSpaCuf5lHBOIEb0Ra201lGcyJHtRHybAciz+hQA9lHj7TnG52qqw==",
"resolved": "2.1.5",
"contentHash": "iEFt7iG7gaBi24xSkEPFywEkZkC4yoE61PEkh2Nspqe8zbwKifSn/05jRlvRnYnanXdON+AzTKxLZf28vgCOsA==",
"dependencies": {
"Microsoft.Build.Tasks.Git": "1.1.1"
}
},
"Gee.External.Capstone": {
"type": "Transitive",
"resolved": "2.3.0",
"contentHash": "2ap/rYmjtzCOT8hxrnEW/QeiOt+paD8iRrIcdKX0cxVwWLFa1e+JDBNeECakmccXrSFeBQuu5AV8SNkipFMMMw=="
},
"Iced": {
"type": "Transitive",
"resolved": "1.17.0",
Expand Down Expand Up @@ -210,8 +213,8 @@
},
"Microsoft.Extensions.ObjectPool": {
"type": "Transitive",
"resolved": "7.0.0",
"contentHash": "udvKco0sAVgYGTBnHUb0tY9JQzJ/nPDiv/8PIyz69wl1AibeCDZOLVVI+6156dPfHmJH7ws5oUJRiW4ZmAvuuA=="
"resolved": "7.0.5",
"contentHash": "uylNo8wuzAeqAJDyLDUM2JWSpTdCHTp11BXCsCO68LXnDjxwDM4PL6mJmho/+fJesWKdcJV5XB/Oa80wAJXnvQ=="
},
"Microsoft.Extensions.Options": {
"type": "Transitive",
Expand Down Expand Up @@ -707,8 +710,15 @@
},
"System.Reflection.Emit": {
"type": "Transitive",
"resolved": "4.7.0",
"contentHash": "VR4kk8XLKebQ4MZuKuIni/7oh+QGFmZW3qORd1GvBq/8026OpW501SzT/oypwiQl4TvT8ErnReh/NzY9u+C6wQ=="
"resolved": "4.0.1",
"contentHash": "P2wqAj72fFjpP6wb9nSfDqNBMab+2ovzSDzUZK7MVIm54tBJEPr9jWfSjjoTpPwj1LeKcmX3vr0ttyjSSFM47g==",
"dependencies": {
"System.IO": "4.1.0",
"System.Reflection": "4.1.0",
"System.Reflection.Emit.ILGeneration": "4.0.1",
"System.Reflection.Primitives": "4.0.1",
"System.Runtime": "4.1.0"
}
},
"System.Reflection.Emit.ILGeneration": {
"type": "Transitive",
Expand All @@ -722,8 +732,14 @@
},
"System.Reflection.Emit.Lightweight": {
"type": "Transitive",
"resolved": "4.7.0",
"contentHash": "a4OLB4IITxAXJeV74MDx49Oq2+PsF6Sml54XAFv+2RyWwtDBcabzoxiiJRhdhx+gaohLh4hEGCLQyBozXoQPqA=="
"resolved": "4.0.1",
"contentHash": "sSzHHXueZ5Uh0OLpUQprhr+ZYJrLPA2Cmr4gn0wj9+FftNKXx8RIMKvO9qnjk2ebPYUjZ+F2ulGdPOsvj+MEjA==",
"dependencies": {
"System.Reflection": "4.1.0",
"System.Reflection.Emit.ILGeneration": "4.0.1",
"System.Reflection.Primitives": "4.0.1",
"System.Runtime": "4.1.0"
}
},
"System.Reflection.Extensions": {
"type": "Transitive",
Expand Down Expand Up @@ -1024,8 +1040,8 @@
},
"System.Text.Json": {
"type": "Transitive",
"resolved": "7.0.0",
"contentHash": "DaGSsVqKsn/ia6RG8frjwmJonfos0srquhw09TlT8KRw5I43E+4gs+/bZj4K0vShJ5H9imCuXupb4RmS+dBy3w==",
"resolved": "7.0.2",
"contentHash": "/LZf/JrGyilojqwpaywb+sSz8Tew7ij4K/Sk+UW8AKfAK7KRhR6mKpKtTm06cYA7bCpGTWfYksIW+mVsdxPegQ==",
"dependencies": {
"System.Text.Encodings.Web": "7.0.0"
}
Expand Down Expand Up @@ -1064,8 +1080,8 @@
},
"System.Threading.Tasks.Extensions": {
"type": "Transitive",
"resolved": "4.5.4",
"contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg=="
"resolved": "4.5.0",
"contentHash": "csAJe24tWCOTO/rXoJAuBGuOq7ZdHY60XtC6b/hNMHT9tuX+2J9HK7nciLEtNvnrRLMxBACLXO3R4y5+kCduMA=="
},
"System.Threading.Timer": {
"type": "Transitive",
Expand Down Expand Up @@ -1121,41 +1137,31 @@
"corvus.uritemplates": {
"type": "Project",
"dependencies": {
"CommunityToolkit.HighPerformance": "[8.0.0, )",
"Microsoft.Extensions.ObjectPool": "[7.0.0, )",
"CommunityToolkit.HighPerformance": "[8.2.0, )",
"Microsoft.Extensions.ObjectPool": "[7.0.5, )",
"System.Buffers": "[4.5.1, )",
"System.Collections.Immutable": "[7.0.0, )"
}
},
"corvus.uritemplates.resolvers.dictionaryofobject": {
"type": "Project",
"dependencies": {
"CommunityToolkit.HighPerformance": "[8.0.0, )",
"CommunityToolkit.HighPerformance": "[8.2.0, )",
"Corvus.UriTemplates": "[1.0.0, )",
"Microsoft.Extensions.ObjectPool": "[7.0.0, )",
"Microsoft.Extensions.ObjectPool": "[7.0.5, )",
"System.Buffers": "[4.5.1, )",
"System.Collections.Immutable": "[7.0.0, )"
}
},
"corvus.uritemplates.resolvers.dictionaryofobject": {
"type": "Project",
"dependencies": {
"CommunityToolkit.HighPerformance": "[8.0.0, )",
"Corvus.UriTemplates": "[1.0.0, )",
"Microsoft.Extensions.ObjectPool": "[7.0.0-rc.1.22427.2, )",
"System.Buffers": "[4.5.1, )",
"System.Collections.Immutable": "[7.0.0-rc.1.22426.10, )"
}
},
"corvus.uritemplates.resolvers.json": {
"type": "Project",
"dependencies": {
"CommunityToolkit.HighPerformance": "[8.0.0, )",
"CommunityToolkit.HighPerformance": "[8.2.0, )",
"Corvus.UriTemplates": "[1.0.0, )",
"Microsoft.Extensions.ObjectPool": "[7.0.0, )",
"Microsoft.Extensions.ObjectPool": "[7.0.5, )",
"System.Buffers": "[4.5.1, )",
"System.Collections.Immutable": "[7.0.0, )",
"System.Text.Json": "[7.0.0, )"
"System.Text.Json": "[7.0.2, )"
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions Solutions/Corvus.UriTemplate.TavisApi.Tests/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# C# files
[*.{cs,csx}]
# Style - implicit and explicit types

csharp_style_var_for_built_in_types = disable
csharp_style_var_when_type_is_apparent = disable
csharp_style_var_elsewhere = disable


# Style - using directives and namespace declarations
csharp_style_namespace_declarations = block_scoped:suggestion
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<IsPackable>false</IsPackable>

<!--
This project contains exact copies of specs from:
https://github.com/tavis-software/Tavis.UriTemplates/blob/master/src/UriTemplateTests/ParameterMatchingTests.cs
(as permissible under the Apache license).
That code does not conform to our coding style, so we need to disable a few warnings.
(We also have a local .editorconfig, but not everything can be handled through that.)
-->
<NoWarn>$(NoWarn);RCS1163;CA1825;IDE0017;IDE0059;IDE0062;IDE0090;IDE0220;IDE1006;xUnit1004</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand All @@ -13,7 +22,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
Expand Down
Loading

0 comments on commit 8eba61c

Please sign in to comment.