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

kysect / Configuin / 9147916069

19 May 2024 01:08PM UTC coverage: 84.596% (-0.6%) from 85.178%
9147916069

Pull #127

github

FrediKats
Replace .editorconfig with DotnetConfig
Pull Request #127: Replace .editorconfig with DotnetConfig in code base

324 of 432 branches covered (75.0%)

Branch coverage included in aggregate %.

468 of 513 new or added lines in 28 files covered. (91.23%)

1977 of 2288 relevant lines covered (86.41%)

1201.67 hits per line

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

86.67
/Sources/Kysect.Configuin.DotnetConfig/Syntax/Nodes/DotnetConfigRuleOptionNode.cs
1
using System.Collections.Immutable;
2
using System.Text;
3

4
namespace Kysect.Configuin.DotnetConfig.Syntax.Nodes;
5

6
public record DotnetConfigRuleOptionNode(
7
    string Key,
8
    EqualSymbolSyntaxNode EqualSymbol,
9
    string Value,
10
    ImmutableList<string> LeadingTrivia,
11
    string? TrailingTrivia
12
) : IDotnetConfigPropertySyntaxNode
13
{
14
    public DotnetConfigRuleOptionNode(string key, EqualSymbolSyntaxNode equalSymbol, string value) : this(key, equalSymbol, value, [], null)
221✔
15
    {
16
    }
221✔
17

18
    public DotnetConfigRuleOptionNode(string key, string value) : this(key, EqualSymbolSyntaxNode.Empty, value, [], null)
19✔
19
    {
20
    }
19✔
21

22
    public IDotnetConfigPropertySyntaxNode WithLeadingTrivia(ImmutableList<string> leadingTrivia)
23
    {
24
        return this with { LeadingTrivia = leadingTrivia };
221✔
25
    }
26

27
    public IDotnetConfigPropertySyntaxNode WithTrailingTrivia(string? trailingTrivia)
28
    {
29
        return this with { TrailingTrivia = trailingTrivia };
1✔
30
    }
31

32
    public string ToFullString()
33
    {
34
        // TODO: reduce duplication
35
        var fullString = $"{Key}{EqualSymbol.ToFullString()}{Value}";
112✔
36
        var stringBuilder = new StringBuilder();
112✔
37
        LeadingTrivia.ForEach(s => stringBuilder.AppendLine(s));
118✔
38

39
        if (TrailingTrivia is not null)
112!
NEW
40
            fullString += $"#{TrailingTrivia}";
×
41

42
        stringBuilder.Append(fullString);
112✔
43
        return stringBuilder.ToString();
112✔
44
    }
45
}
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