Skip to content

Commit b201d09

Browse files
committed
Merge from v8
2 parents 67e2834 + aa5475e commit b201d09

17 files changed

+97
-69
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup .NET SDK
2222
uses: actions/setup-dotnet@v4
2323
with:
24-
dotnet-version: 7.0.x
24+
dotnet-version: 8.0.x
2525

2626
- name: Initialize CodeQL
2727
uses: github/codeql-action/init@v2

.github/workflows/publish-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup .NET SDK
2828
uses: actions/setup-dotnet@v4
2929
with:
30-
dotnet-version: 7.0.x
30+
dotnet-version: 8.0.x
3131
source-url: https://nuget.pkg.github.com/graphql-dotnet/index.json
3232
env:
3333
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/publish-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Setup .NET SDK
3434
uses: actions/setup-dotnet@v4
3535
with:
36-
dotnet-version: 7.0.x
36+
dotnet-version: 8.0.x
3737
source-url: https://api.nuget.org/v3/index.json
3838
env:
3939
NUGET_AUTH_TOKEN: ${{secrets.NUGET_AUTH_TOKEN}}

.github/workflows/test.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,12 @@ jobs:
3838
uses: actions/setup-dotnet@v4
3939
with:
4040
dotnet-version: |
41-
3.1.x
4241
6.0.x
4342
7.0.x
43+
8.0.x
4444
source-url: https://nuget.pkg.github.com/graphql-dotnet/index.json
4545
env:
4646
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
47-
- name: Disable MSVS Nuget Source # see https://github.com/graphql-dotnet/graphql-dotnet/issues/2422
48-
if: ${{ startsWith(matrix.os, 'windows') }}
49-
run: dotnet nuget disable source 'Microsoft Visual Studio Offline Packages'
5047
- name: Install dependencies
5148
working-directory: src
5249
run: dotnet restore
@@ -73,7 +70,7 @@ jobs:
7370
if: ${{ startsWith(matrix.os, 'ubuntu') }}
7471
uses: codecov/codecov-action@v3
7572
with:
76-
files: .coverage/GraphQLParser.Tests/coverage.net5.opencover.xml
73+
files: .coverage/GraphQLParser.Tests/coverage.net8.opencover.xml
7774

7875
buildcheck:
7976
needs:

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Preview versions of this package are available on [GitHub Packages](https://gith
2222
Generates token based on input text. Lexer takes advantage of `ReadOnlyMemory<char>` and in most cases
2323
does not allocate memory on the managed heap at all.
2424

25-
### Usage
25+
Usage:
2626

2727
```csharp
2828
var token = Lexer.Lex("\"str\"");
@@ -36,7 +36,7 @@ Lex method always returns the first token it finds. In this case case the result
3636
Parses provided GraphQL expression into AST (abstract syntax tree). Parser also takes advantage of
3737
`ReadOnlyMemory<char>` but still allocates memory for AST.
3838

39-
### Usage
39+
Usage:
4040

4141
```csharp
4242
var ast1 = Parser.Parse(@"
@@ -95,7 +95,8 @@ new SDLPrinter().Print(document, sb);
9595

9696
// print to a string with some options
9797
var sdlPrinter = new SDLPrinter(
98-
new SDLPrinterOptions {
98+
new SDLPrinterOptions
99+
{
99100
PrintComments = true,
100101
EachDirectiveLocationOnNewLine = true,
101102
EachUnionMemberOnNewLine = true,
@@ -122,8 +123,8 @@ query {
122123
### SDLSorter
123124

124125
An AST document can be sorted with the `SDLSorter` using a predefined
125-
sort order. You can specify the string comparison; by default it uses
126-
a culture-invariant case-insensitive comparison. Any futher customization
126+
sort order. You can specify the string comparison; by default it uses
127+
a culture-invariant case-insensitive comparison. Any futher customization
127128
is possible by deriving from `SDLSorterOptions` and overriding the `Compare`
128129
methods.
129130

src/GraphQLParser.ApiTests/ApiApprovalTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void Public_Api_Should_Not_Change_Inadvertently(Type type)
3434
{
3535
IncludeAssemblyAttributes = false,
3636
//WhitelistedNamespacePrefixes = new[] { "Microsoft.Extensions.DependencyInjection" },
37-
ExcludeAttributes = new[] { "System.Diagnostics.DebuggerDisplayAttribute", "System.Diagnostics.CodeAnalysis.AllowNullAttribute" }
37+
ExcludeAttributes = ["System.Diagnostics.DebuggerDisplayAttribute", "System.Diagnostics.CodeAnalysis.AllowNullAttribute"]
3838
}))).ToArray();
3939

4040
if (publicApi.DistinctBy(item => item.content).Count() == 1)

src/GraphQLParser.ApiTests/GraphQLParser.ApiTests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7</TargetFramework>
4+
<TargetFramework>net8</TargetFramework>
55
<NoWarn>$(NoWarn);1591</NoWarn>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
@@ -10,8 +10,8 @@
1010
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
1111
<PackageReference Include="Shouldly" Version="4.2.1" />
1212
<PackageReference Include="xunit" Version="2.6.3" />
13-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1" />
14-
<PackageReference Include="PublicApiGenerator" Version="11.0.0" />
13+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5" />
14+
<PackageReference Include="PublicApiGenerator" Version="11.1.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

src/GraphQLParser.Benchmarks/GraphQLParser.Benchmarks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7</TargetFramework>
4+
<TargetFramework>net8</TargetFramework>
55
<OutputType>Exe</OutputType>
66
<IsPackable>false</IsPackable>
77
<NoWarn>$(NoWarn);1591;CA1822</NoWarn>

src/GraphQLParser.Tests/GraphQLParser.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<PropertyGroup>
55
<SingleTestPlatform Condition="'$(SingleTestPlatform)' == ''">false</SingleTestPlatform>
66
<Nullable>disable</Nullable>
7-
<NoWarn>$(NoWarn);1591;CA2012;IDE0008;IDE0022;IDE0058;IDE1006</NoWarn>
7+
<NoWarn>$(NoWarn);1591;CA2012;CA1861;IDE0008;IDE0022;IDE0058;IDE1006</NoWarn>
88
<CheckEolTargetFramework>false</CheckEolTargetFramework>
99
</PropertyGroup>
1010

@@ -13,7 +13,7 @@
1313
</PropertyGroup>
1414

1515
<PropertyGroup Condition="'$(SingleTestPlatform)' != 'true'">
16-
<TargetFrameworks>netcoreapp3.1;net6;net7</TargetFrameworks>
16+
<TargetFrameworks>net6;net7;net8</TargetFrameworks>
1717
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks>
1818
</PropertyGroup>
1919

@@ -28,8 +28,8 @@
2828
</PackageReference>
2929
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
3030
<PackageReference Include="Shouldly" Version="4.2.1" />
31-
<PackageReference Include="xunit" Version="2.5.3" />
32-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
31+
<PackageReference Include="xunit" Version="2.6.3" />
32+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5" />
3333
</ItemGroup>
3434

3535
<ItemGroup>

src/GraphQLParser.Tests/NodeHelperTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ public void NodeHelper_Should_Return_Proper_Nodes_1()
88
foreach (var method in typeof(NodeHelper).GetMethods().Where(m => m.IsStatic))
99
{
1010
var node = method.GetParameters().Length == 1
11-
? (ASTNode)method.Invoke(null, new object[] { IgnoreOptions.None })
12-
: (ASTNode)method.Invoke(null, new object[] { IgnoreOptions.None, Activator.CreateInstance(method.GetParameters()[1].ParameterType) });
11+
? (ASTNode)method.Invoke(null, [IgnoreOptions.None])
12+
: (ASTNode)method.Invoke(null, [IgnoreOptions.None, Activator.CreateInstance(method.GetParameters()[1].ParameterType)]);
1313

1414
node.Comments = new List<GraphQLComment> { new GraphQLComment("abcdef") };
1515
if (node is not GraphQLComment &&
@@ -29,8 +29,8 @@ public void NodeHelper_Should_Return_Proper_Nodes_2()
2929
foreach (var method in typeof(NodeHelper).GetMethods().Where(m => m.IsStatic))
3030
{
3131
var node = method.GetParameters().Length == 1
32-
? (ASTNode)method.Invoke(null, new object[] { IgnoreOptions.Comments })
33-
: (ASTNode)method.Invoke(null, new object[] { IgnoreOptions.Comments, Activator.CreateInstance(method.GetParameters()[1].ParameterType) });
32+
? (ASTNode)method.Invoke(null, [IgnoreOptions.Comments])
33+
: (ASTNode)method.Invoke(null, [IgnoreOptions.Comments, Activator.CreateInstance(method.GetParameters()[1].ParameterType)]);
3434

3535
node.Comments = new List<GraphQLComment> { new GraphQLComment("abcdef") };
3636
node.Comment.ShouldBeNull();
@@ -46,8 +46,8 @@ public void NodeHelper_Should_Return_Proper_Nodes_3()
4646
foreach (var method in typeof(NodeHelper).GetMethods().Where(m => m.IsStatic))
4747
{
4848
var node = method.GetParameters().Length == 1
49-
? (ASTNode)method.Invoke(null, new object[] { IgnoreOptions.Locations })
50-
: (ASTNode)method.Invoke(null, new object[] { IgnoreOptions.Locations, Activator.CreateInstance(method.GetParameters()[1].ParameterType) });
49+
? (ASTNode)method.Invoke(null, [IgnoreOptions.Locations])
50+
: (ASTNode)method.Invoke(null, [IgnoreOptions.Locations, Activator.CreateInstance(method.GetParameters()[1].ParameterType)]);
5151

5252
node.Comments = new List<GraphQLComment> { new GraphQLComment("abcdef") };
5353
if (node is not GraphQLComment &&
@@ -67,8 +67,8 @@ public void NodeHelper_Should_Return_Proper_Nodes_4()
6767
foreach (var method in typeof(NodeHelper).GetMethods().Where(m => m.IsStatic))
6868
{
6969
var node = method.GetParameters().Length == 1
70-
? (ASTNode)method.Invoke(null, new object[] { IgnoreOptions.All })
71-
: (ASTNode)method.Invoke(null, new object[] { IgnoreOptions.All, Activator.CreateInstance(method.GetParameters()[1].ParameterType) });
70+
? (ASTNode)method.Invoke(null, [IgnoreOptions.All])
71+
: (ASTNode)method.Invoke(null, [IgnoreOptions.All, Activator.CreateInstance(method.GetParameters()[1].ParameterType)]);
7272

7373
node.Comments = new List<GraphQLComment> { new GraphQLComment("abcdef") };
7474
node.Comment.ShouldBeNull();

0 commit comments

Comments
 (0)