From 3854bb9f6d42818d96fa20ec3dd128806fd4c6ee Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Sat, 31 Aug 2024 21:35:05 +0200 Subject: [PATCH 1/2] Enable #nullable annotations and disable warnings --- src/Refitter.Core/RefitGenerator.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Refitter.Core/RefitGenerator.cs b/src/Refitter.Core/RefitGenerator.cs index 4db5263a..ef05c0bc 100644 --- a/src/Refitter.Core/RefitGenerator.cs +++ b/src/Refitter.Core/RefitGenerator.cs @@ -226,7 +226,8 @@ private RefitGeneratedCode GenerateClient(IRefitInterfaceGenerator interfaceGene code.AppendLine(); } - code.AppendLine("#nullable enable"); + code.AppendLine("#nullable enable annotations"); + code.AppendLine("#nullable disable warnings"); var refitInterfaces = interfaceGenerator.GenerateCode(); code.AppendLine($$""" From b9708ccd3a8d1df4ffff9964ab39e4196fd99a59 Mon Sep 17 00:00:00 2001 From: Christian Helle Date: Mon, 2 Sep 2024 10:46:19 +0200 Subject: [PATCH 2/2] Remove explicit #nullable disable warnings --- src/Refitter.Core/RefitGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Refitter.Core/RefitGenerator.cs b/src/Refitter.Core/RefitGenerator.cs index ef05c0bc..e00ec63c 100644 --- a/src/Refitter.Core/RefitGenerator.cs +++ b/src/Refitter.Core/RefitGenerator.cs @@ -227,7 +227,7 @@ private RefitGeneratedCode GenerateClient(IRefitInterfaceGenerator interfaceGene } code.AppendLine("#nullable enable annotations"); - code.AppendLine("#nullable disable warnings"); + code.AppendLine(); var refitInterfaces = interfaceGenerator.GenerateCode(); code.AppendLine($$"""