Skip to content

Commit 2007685

Browse files
authored
Merge pull request #522 from GitTools/dependabot/nuget/src/YamlDotNet-13.3.1
Bump YamlDotNet from 11.2.1 to 13.3.1 in /src
2 parents 789b12d + 8361c98 commit 2007685

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/GitReleaseManager.Core/Configuration/ConfigSerializer.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,23 @@ public static Config Read(TextReader reader)
3636
}
3737

3838
public static void Write(Config config, TextWriter writer)
39+
{
40+
Write(config, writer, newLine: string.Empty);
41+
}
42+
43+
public static void Write(Config config, TextWriter writer, string newLine)
3944
{
4045
_logger.Debug("Starting serializing yaml configuration...");
4146
var serializerBuilder = new SerializerBuilder()
4247
.WithTypeInspector(inner => new CommentGatheringTypeInspector(inner))
4348
.WithEmissionPhaseObjectGraphVisitor(args => new CommentsObjectGraphVisitor(args.InnerVisitor))
4449
.WithNamingConvention(HyphenatedNamingConvention.Instance);
50+
51+
if (!string.IsNullOrEmpty(newLine))
52+
{
53+
serializerBuilder = serializerBuilder.WithNewLine(newLine);
54+
}
55+
4556
var serializer = serializerBuilder.Build();
4657
serializer.Serialize(writer, config);
4758
_logger.Verbose("Successfully serialized configuration!");
@@ -67,11 +78,10 @@ public static void WriteSample(TextWriter writer)
6778
var configType = config.GetType();
6879

6980
writer.Write("#");
70-
writer.NewLine = Environment.NewLine + "#";
7181
SetConfigurationSamples(config, configType, writer);
7282

7383
_logger.Verbose("Writing sample");
74-
Write(config, writer);
84+
Write(config, writer, newLine: Environment.NewLine + "#");
7585
}
7686

7787
private static void SetConfigurationSamples(object config, Type configType, TextWriter writer)

src/GitReleaseManager.Core/GitReleaseManager.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<PackageReference Include="Octokit" Version="7.1.0" />
2727
<PackageReference Include="Scriban" Version="5.7.0" />
2828
<PackageReference Include="seriloganalyzer" Version="0.15.0" />
29-
<PackageReference Include="YamlDotNet" Version="11.2.1" />
29+
<PackageReference Include="YamlDotNet" Version="13.3.1" />
3030
<PackageReference Include="AutoMapper" Version="10.1.1" />
3131
</ItemGroup>
3232
<ItemGroup>

0 commit comments

Comments
 (0)