Skip to content

Commit 10cfaad

Browse files
authored
Merge pull request #407 from LogExperts/var_in_solution
var in all the solution filescoped namespace
2 parents b91051e + 7efbe92 commit 10cfaad

236 files changed

Lines changed: 17296 additions & 17553 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build/Build.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ protected override void OnBuildInitialized()
443443

444444
AppveyorArtifacts.ForEach((artifact) =>
445445
{
446-
Process proc = new Process();
446+
var proc = new Process();
447447
proc.StartInfo = new ProcessStartInfo("appveyor", $"PushArtifact \"{artifact}\"");
448448
if (!proc.Start())
449449
{
@@ -464,7 +464,7 @@ protected override void OnBuildInitialized()
464464
{
465465
AbsolutePath logExpertApplicationData = SpecialFolder(SpecialFolders.ApplicationData) / "LogExpert";
466466

467-
DirectoryInfo info = new DirectoryInfo(logExpertApplicationData);
467+
var info = new DirectoryInfo(logExpertApplicationData);
468468
info.GetDirectories().ForEach(a => a.Delete(true));
469469
logExpertApplicationData.DeleteDirectory();
470470
});
@@ -474,7 +474,7 @@ protected override void OnBuildInitialized()
474474
{
475475
AbsolutePath logExpertDocuments = SpecialFolder(SpecialFolders.UserProfile) / "Documents" / "LogExpert";
476476

477-
DirectoryInfo info = new DirectoryInfo(logExpertDocuments);
477+
var info = new DirectoryInfo(logExpertDocuments);
478478
info.GetDirectories().ForEach(a => a.Delete(true));
479479
logExpertDocuments.DeleteDirectory();
480480
});

src/.editorconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ dotnet_code_quality.CA1001.excluded_symbol_names =
555555
dotnet_code_quality.CA1001.excluded_type_names_with_derived_types =
556556

557557
# CA1002: Do not expose generic lists
558-
dotnet_diagnostic.CA1002.severity = warning
558+
dotnet_diagnostic.CA1002.severity = suggestion
559559
dotnet_code_quality.CA1002.api_surface = all
560560

561561
# CA1003: Use generic event handler instances
@@ -906,7 +906,7 @@ dotnet_code_quality.CA1806.additional_use_results_methods =
906906
dotnet_diagnostic.CA1810.severity = warning
907907

908908
# CA1812: Avoid uninstantiated internal classes
909-
dotnet_diagnostic.CA1812.severity = warning
909+
dotnet_diagnostic.CA1812.severity = None
910910

911911
# CA1813: Avoid unsealed attributes
912912
dotnet_diagnostic.CA1813.severity = suggestion
@@ -1021,7 +1021,7 @@ dotnet_diagnostic.CA1849.severity = warning
10211021
dotnet_diagnostic.CA1850.severity = warning
10221022

10231023
# CA2000: Dispose objects before losing scope
1024-
dotnet_diagnostic.CA2000.severity = warning
1024+
dotnet_diagnostic.CA2000.severity = None
10251025
dotnet_code_quality.CA2000.excluded_symbol_names =
10261026
dotnet_code_quality.CA2000.excluded_type_names_with_derived_types =
10271027
dotnet_code_quality.CA2000.dispose_analysis_kind = NonExceptionPaths
@@ -1100,7 +1100,7 @@ dotnet_code_quality.CA2208.api_surface = all
11001100
dotnet_diagnostic.CA2211.severity = warning
11011101

11021102
# CA2213: Disposable fields should be disposed
1103-
dotnet_diagnostic.CA2213.severity = warning
1103+
dotnet_diagnostic.CA2213.severity = None
11041104

11051105
# CA2214: Do not call overridable methods in constructors
11061106
dotnet_diagnostic.CA2214.severity = warning

src/AutoColumnizer/AutoColumnizer.cs

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,64 +2,63 @@
22

33
using System;
44

5-
namespace AutoColumnizer
6-
{
7-
public class AutoColumnizer : ILogLineColumnizer
8-
{
9-
#region ILogLineColumnizer implementation
5+
namespace AutoColumnizer;
106

11-
public string Text => GetName();
7+
public class AutoColumnizer : ILogLineColumnizer
8+
{
9+
#region ILogLineColumnizer implementation
1210

13-
public bool IsTimeshiftImplemented()
14-
{
15-
return true;
16-
}
11+
public string Text => GetName();
1712

18-
public string GetName()
19-
{
20-
return "Auto Columnizer";
21-
}
13+
public bool IsTimeshiftImplemented()
14+
{
15+
return true;
16+
}
2217

23-
public string GetDescription()
24-
{
25-
return "Automatically find the right columnizer for any file";
26-
}
18+
public string GetName()
19+
{
20+
return "Auto Columnizer";
21+
}
2722

23+
public string GetDescription()
24+
{
25+
return "Automatically find the right columnizer for any file";
26+
}
2827

29-
public int GetColumnCount()
30-
{
31-
throw new NotImplementedException();
32-
}
3328

34-
public string[] GetColumnNames()
35-
{
36-
throw new NotImplementedException();
37-
}
29+
public int GetColumnCount()
30+
{
31+
throw new NotImplementedException();
32+
}
3833

39-
public IColumnizedLogLine SplitLine(ILogLineColumnizerCallback callback, ILogLine line)
40-
{
41-
throw new NotImplementedException();
42-
}
34+
public string[] GetColumnNames()
35+
{
36+
throw new NotImplementedException();
37+
}
4338

44-
public void SetTimeOffset(int msecOffset)
45-
{
46-
throw new NotImplementedException();
47-
}
39+
public IColumnizedLogLine SplitLine(ILogLineColumnizerCallback callback, ILogLine line)
40+
{
41+
throw new NotImplementedException();
42+
}
4843

49-
public int GetTimeOffset()
50-
{
51-
throw new NotImplementedException();
52-
}
44+
public void SetTimeOffset(int msecOffset)
45+
{
46+
throw new NotImplementedException();
47+
}
5348

54-
public DateTime GetTimestamp(ILogLineColumnizerCallback callback, ILogLine line)
55-
{
56-
throw new NotImplementedException();
57-
}
49+
public int GetTimeOffset()
50+
{
51+
throw new NotImplementedException();
52+
}
5853

59-
public void PushValue(ILogLineColumnizerCallback callback, int column, string value, string oldValue)
60-
{
61-
}
54+
public DateTime GetTimestamp(ILogLineColumnizerCallback callback, ILogLine line)
55+
{
56+
throw new NotImplementedException();
57+
}
6258

63-
#endregion ILogLineColumnizer implementation
59+
public void PushValue(ILogLineColumnizerCallback callback, int column, string value, string oldValue)
60+
{
6461
}
62+
63+
#endregion ILogLineColumnizer implementation
6564
}

src/ColumnizerLib.UnitTests/ColumnTests.cs

Lines changed: 56 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,83 +3,82 @@
33
using System;
44
using System.Text;
55

6-
namespace ColumnizerLib.UnitTests
6+
namespace ColumnizerLib.UnitTests;
7+
8+
[TestFixture]
9+
public class ColumnTests
710
{
8-
[TestFixture]
9-
public class ColumnTests
11+
[Test]
12+
public void Column_LineCutOf()
1013
{
11-
[Test]
12-
public void Column_LineCutOf()
14+
Column column = new();
15+
16+
StringBuilder builder = new();
17+
18+
for (var i = 0; i < 4675; i++)
1319
{
14-
Column column = new();
20+
builder.Append("6");
21+
}
1522

16-
StringBuilder builder = new();
23+
var expected = builder + "...";
24+
builder.Append("1234");
1725

18-
for (int i = 0; i < 4675; i++)
19-
{
20-
builder.Append("6");
21-
}
26+
column.FullValue = builder.ToString();
2227

23-
string expected = builder + "...";
24-
builder.Append("1234");
28+
Assert.That(column.DisplayValue, Is.EqualTo(expected));
29+
Assert.That(column.FullValue, Is.EqualTo(builder.ToString()));
30+
}
2531

26-
column.FullValue = builder.ToString();
32+
[Test]
33+
public void Column_NoLineCutOf()
34+
{
35+
Column column = new();
2736

28-
Assert.That(column.DisplayValue, Is.EqualTo(expected));
29-
Assert.That(column.FullValue, Is.EqualTo(builder.ToString()));
30-
}
37+
StringBuilder builder = new();
3138

32-
[Test]
33-
public void Column_NoLineCutOf()
39+
for (var i = 0; i < 4675; i++)
3440
{
35-
Column column = new();
41+
builder.Append("6");
42+
}
43+
44+
var expected = builder.ToString();
3645

37-
StringBuilder builder = new();
46+
column.FullValue = expected;
3847

39-
for (int i = 0; i < 4675; i++)
40-
{
41-
builder.Append("6");
42-
}
48+
Assert.That(column.DisplayValue, Is.EqualTo(expected));
49+
Assert.That(column.FullValue, Is.EqualTo(expected));
50+
}
4351

44-
string expected = builder.ToString();
52+
[Test]
53+
public void Column_NullCharReplacement()
54+
{
55+
Column column = new();
4556

46-
column.FullValue = expected;
57+
column.FullValue = "asdf\0";
4758

48-
Assert.That(column.DisplayValue, Is.EqualTo(expected));
49-
Assert.That(column.FullValue, Is.EqualTo(expected));
59+
//Switch between the different implementation for the windows versions
60+
//Not that great solution but currently I'm out of ideas, I know that currently
61+
//only one implementation depending on the windows version is executed
62+
if (Environment.Version >= Version.Parse("6.2"))
63+
{
64+
Assert.That(column.DisplayValue, Is.EqualTo("asdf␀"));
5065
}
51-
52-
[Test]
53-
public void Column_NullCharReplacement()
66+
else
5467
{
55-
Column column = new();
56-
57-
column.FullValue = "asdf\0";
58-
59-
//Switch between the different implementation for the windows versions
60-
//Not that great solution but currently I'm out of ideas, I know that currently
61-
//only one implementation depending on the windows version is executed
62-
if (Environment.Version >= Version.Parse("6.2"))
63-
{
64-
Assert.That(column.DisplayValue, Is.EqualTo("asdf␀"));
65-
}
66-
else
67-
{
68-
Assert.That(column.DisplayValue, Is.EqualTo("asdf "));
69-
}
70-
71-
Assert.That(column.FullValue, Is.EqualTo("asdf\0"));
68+
Assert.That(column.DisplayValue, Is.EqualTo("asdf "));
7269
}
7370

74-
[Test]
75-
public void Column_TabReplacement()
76-
{
77-
Column column = new();
71+
Assert.That(column.FullValue, Is.EqualTo("asdf\0"));
72+
}
73+
74+
[Test]
75+
public void Column_TabReplacement()
76+
{
77+
Column column = new();
7878

79-
column.FullValue = "asdf\t";
79+
column.FullValue = "asdf\t";
8080

81-
Assert.That(column.DisplayValue, Is.EqualTo("asdf "));
82-
Assert.That(column.FullValue, Is.EqualTo("asdf\t"));
83-
}
81+
Assert.That(column.DisplayValue, Is.EqualTo("asdf "));
82+
Assert.That(column.FullValue, Is.EqualTo("asdf\t"));
8483
}
8584
}

src/ColumnizerLib.UnitTests/Extensions/LogLineExtensionsTests.cs

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,30 @@
33

44
using NUnit.Framework;
55

6-
namespace ColumnizerLib.UnitTests.Extensions
7-
{
8-
[TestFixture]
6+
namespace ColumnizerLib.UnitTests.Extensions;
7+
8+
[TestFixture]
99

10-
internal class LogLineExtensionsTests
10+
internal class LogLineExtensionsTests
11+
{
12+
private class TestingLogLine : ILogLine
1113
{
12-
private class TestingLogLine : ILogLine
13-
{
14-
public string FullLine { get; set; }
14+
public string FullLine { get; set; }
1515

16-
public int LineNumber { get; set; }
16+
public int LineNumber { get; set; }
1717

18-
public string Text { get; set; }
19-
}
18+
public string Text { get; set; }
19+
}
2020

21-
[Test]
22-
public void ToClipBoardText_ReturnsExpected()
21+
[Test]
22+
public void ToClipBoardText_ReturnsExpected()
23+
{
24+
var underTest = new TestingLogLine
2325
{
24-
var underTest = new TestingLogLine
25-
{
26-
FullLine = "a fullLine",
27-
LineNumber = 89,
28-
Text = "a text"
29-
};
30-
Assert.That(underTest.ToClipBoardText(), Is.EqualTo("\t90\ta fullLine"));
31-
}
26+
FullLine = "a fullLine",
27+
LineNumber = 89,
28+
Text = "a text"
29+
};
30+
Assert.That(underTest.ToClipBoardText(), Is.EqualTo("\t90\ta fullLine"));
3231
}
3332
}

0 commit comments

Comments
 (0)