• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kysect / Configuin / 9090894826

15 May 2024 06:15AM UTC coverage: 80.585% (+1.7%) from 78.934%
9090894826

Pull #103

github

FrediKats
Implement .editorconfig model serialization
Pull Request #103: Add .editorconfig document model

196 of 298 branches covered (65.77%)

Branch coverage included in aggregate %.

239 of 252 new or added lines in 12 files covered. (94.84%)

1568 of 1891 relevant lines covered (82.92%)

591.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/Sources/Kysect.Configuin.EditorConfig/DocumentModel/Nodes/EditorConfigDocumentSectionNode.cs
1
using System.Collections.Immutable;
2
using System.Text;
3

4
namespace Kysect.Configuin.EditorConfig.DocumentModel.Nodes;
5

6
public record EditorConfigDocumentSectionNode(string Value, ImmutableList<IEditorConfigNode> Children, ImmutableList<string> LeadingTrivia, string? TrailingTrivia) : IEditorConfigContainerNode
7
{
8
    public const string NodeIndicator = "###";
9

10
    public EditorConfigDocumentSectionNode(string value) : this(value, ImmutableList<IEditorConfigNode>.Empty, ImmutableList<string>.Empty, null)
5✔
11
    {
12
    }
5✔
13

14
    IEditorConfigContainerNode IEditorConfigContainerNode.AddChild(IEditorConfigNode child)
15
    {
NEW
16
        return this with { Children = Children.Add(child) };
×
17
    }
18

19
    public EditorConfigDocumentSectionNode AddChild(IEditorConfigNode child)
20
    {
21
        return this with { Children = Children.Add(child) };
7✔
22
    }
23

24
    public string ToFullString()
25
    {
26
        var stringBuilder = new StringBuilder();
1✔
27
        LeadingTrivia.ForEach(s => stringBuilder.AppendLine(s));
1✔
28

29
        string line = $"{Value}";
1!
30
        if (TrailingTrivia is not null)
1!
NEW
31
            line += $"{line} {TrailingTrivia}";
×
32
        stringBuilder.Append(line);
1✔
33

34
        Children.ForEach(c => stringBuilder.Append($"{Environment.NewLine}{c.ToFullString()}"));
2✔
35
        return stringBuilder.ToString();
1✔
36
    }
37
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc