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

kysect / Configuin / 9148112992

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

push

github

FrediKats
Replace .editorconfig with DotnetConfig

324 of 432 branches covered (75.0%)

Branch coverage included in aggregate %.

314 of 347 new or added lines in 28 files covered. (90.49%)

2 existing lines in 1 file now uncovered.

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

0.0
/Sources/Kysect.Configuin.DotnetFormatIntegration/DotnetFormatPreviewGenerator.cs
1
using Kysect.CommonLib.Collections.Diff;
2
using Kysect.CommonLib.Logging;
3
using Kysect.Configuin.DotnetFormatIntegration.Abstractions;
4
using Kysect.Configuin.DotnetFormatIntegration.Cli;
5
using Kysect.Configuin.DotnetFormatIntegration.FileSystem;
6
using Microsoft.Extensions.Logging;
7

8
namespace Kysect.Configuin.DotnetFormatIntegration;
9

10
public class DotnetFormatPreviewGenerator : IDotnetFormatPreviewGenerator
11
{
12
    private readonly DotnetFormatWarningGenerator _dotnetFormatWarningGenerator;
13
    private readonly TemporaryFileMover _temporaryFileMover;
14
    private readonly DotnetFormatReportComparator _dotnetFormatReportComparator;
15
    private readonly ILogger _logger;
16

17
    public DotnetFormatPreviewGenerator(
18
        DotnetFormatWarningGenerator dotnetFormatWarningGenerator,
19
        TemporaryFileMover temporaryFileMover,
20
        DotnetFormatReportComparator dotnetFormatReportComparator,
21
        ILogger logger)
22
    {
23
        _dotnetFormatWarningGenerator = dotnetFormatWarningGenerator;
×
24
        _temporaryFileMover = temporaryFileMover;
×
25
        _dotnetFormatReportComparator = dotnetFormatReportComparator;
×
26
        _logger = logger;
×
27
    }
×
28

29
    public void GetWarningsAfterChangingDotnetConfig(string solutionPath, string newDotnetConfig, string sourceDotnetConfig)
30
    {
31
        IReadOnlyCollection<DotnetFormatFileReport> originalWarnings = _dotnetFormatWarningGenerator.GenerateWarnings(solutionPath);
×
32

NEW
33
        IFileMoveUndoOperation undoOperation = _temporaryFileMover.MoveFile(newDotnetConfig, sourceDotnetConfig);
×
34
        IReadOnlyCollection<DotnetFormatFileReport> newWarnings = _dotnetFormatWarningGenerator.GenerateWarnings(solutionPath);
×
35
        undoOperation.Undo();
×
36

37
        CollectionDiff<DotnetFormatFileReport> warningDiff = _dotnetFormatReportComparator.Compare(originalWarnings, newWarnings);
×
38

39
        _logger.LogInformation("New warnings count: {Count}", warningDiff.Added.Count);
×
40
        foreach (DotnetFormatFileReport dotnetFormatFileReport in warningDiff.Added)
×
41
        {
42
            _logger.LogTabInformation(1, $"{dotnetFormatFileReport.FilePath}");
×
43
            foreach (DotnetFormatFileChanges dotnetFormatFileChanges in dotnetFormatFileReport.FileChanges)
×
44
                _logger.LogTabInformation(2, $"{dotnetFormatFileChanges.FormatDescription}");
×
45
        }
46
    }
×
47
}
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