Skip to content

Commit

Permalink
Merge pull request #8 from FizzcodeSoftware/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
wickedmachinator authored Jan 17, 2024
2 parents e6becd8 + 2353dff commit fdea44d
Show file tree
Hide file tree
Showing 58 changed files with 107 additions and 143 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,22 @@ dotnet_diagnostic.RCS1194.severity = none
# RCS1163: Unused parameter.
dotnet_diagnostic.RCS1163.severity = silent

# RCS1097: Remove redundant 'ToString' call
dotnet_diagnostic.RCS1097.severity = silent

# RCS1239: Use 'for' statement instead of 'while' statement.
dotnet_diagnostic.RCS1239.severity = silent
csharp_style_prefer_primary_constructors = true:suggestion

# RCS1158: Static member in generic type should use a type parameter
dotnet_diagnostic.RCS1158.severity = silent

# RCS1202: Avoid NullReferenceException
dotnet_diagnostic.RCS1202.severity = silent

# RCS1075: Avoid empty catch clause that catches System.Exception
dotnet_diagnostic.RCS1075.severity = silent

[*.vb]
# Modifier preferences
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
4 changes: 2 additions & 2 deletions EtLast.AdoNet.MsSql/EtLast.AdoNet.MsSql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

<ItemGroup>
<PackageReference Include="FizzCode.LightWeight.AdoNet.DbConnection" Version="2.0.42.7056" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.2" />
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.7.0">
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.4" />
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ private class TableWithOrder
}
}


[EditorBrowsable(EditorBrowsableState.Never)]
public static class ResilientSqlScopeFluent
{
Expand Down
2 changes: 1 addition & 1 deletion EtLast.AdoNet.PostgreSql/EtLast.AdoNet.PostgreSql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<ItemGroup>
<PackageReference Include="FizzCode.LightWeight.AdoNet.DbConnection" Version="2.0.42.7056" />
<PackageReference Include="Npgsql" Version="8.0.1" />
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.7.0">
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion EtLast.AdoNet/EtLast.AdoNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<ItemGroup>
<PackageReference Include="FizzCode.LightWeight.AdoNet.DbConnection" Version="2.0.42.7056" />
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.7.0">
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
5 changes: 1 addition & 4 deletions EtLast.AdoNet/EtlConnectionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,7 @@ public static void ReleaseConnection(IProcess process, ref DatabaseConnection co
});
},
onClosed: connection => ioCommand.End(),
onError: (connection, ex) =>
{
ioCommand.Failed(ex);
});
onError: (connection, ex) => ioCommand.Failed(ex));

if (connection == null)
return;
Expand Down
1 change: 0 additions & 1 deletion EtLast.AdoNet/Mutators/MergeToSql/MergeToSqlMutator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ private void ExecuteStatements()
_command = null;
_statements.Clear();
}

}

[EditorBrowsable(EditorBrowsableState.Never)]
Expand Down
1 change: 1 addition & 0 deletions EtLast.ConsoleHost/CommandImplementations/ModuleLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ private static List<Type> FindTypesFromAppDomain<T>(string moduleName)
{
var matchingTypes = assembly.GetTypes()
.Where(t => t.IsClass && !t.IsAbstract && interfaceType.IsAssignableFrom(t) && t.Namespace.EndsWith(moduleName, StringComparison.OrdinalIgnoreCase));

result.AddRange(matchingTypes);
}
catch (Exception) { }
Expand Down
2 changes: 2 additions & 0 deletions EtLast.ConsoleHost/ConsoleHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public ConsoleHost(string name)
HostArgumentsFolder = @".\HostArguments";
ReferenceAssemblyFolders.Add(@"C:\Program Files\dotnet\shared\Microsoft.NETCore.App\");
ReferenceAssemblyFolders.Add(@"C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\");

AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
}

protected override ILogger CreateHostLogger()
Expand Down
2 changes: 1 addition & 1 deletion EtLast.ConsoleHost/ConsoleHostSessionBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[EditorBrowsable(EditorBrowsableState.Never)]
public static class ConsoleHostSessionBuilderExtensions
{
public static ISessionBuilder UseRollingDevLogManifestFiles<T>(this ISessionBuilder session, int? maxFileCount, int? maxSizeOnDisk = 16 * 1024 * 1024)
public static ISessionBuilder UseRollingDevLogManifestFiles(this ISessionBuilder session, int? maxFileCount, int? maxSizeOnDisk = 16 * 1024 * 1024)
{
var folder = Path.Combine(session.DevLogFolder, "manifest");
CleanupManifestFolder(maxFileCount, maxSizeOnDisk, folder);
Expand Down
2 changes: 1 addition & 1 deletion EtLast.ConsoleHost/EtLast.ConsoleHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.7.0">
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
6 changes: 0 additions & 6 deletions EtLast.ConsoleHost/Global.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,10 @@
global using System.IO;
global using System.Linq;
global using System.Reflection;
global using System.Runtime.InteropServices;
global using System.Runtime.Loader;
global using System.Text;
global using System.Text.Json;
global using System.Text.RegularExpressions;
global using System.Threading;
global using System.Transactions;
global using Serilog;
global using Serilog.Core;
global using Serilog.Events;
global using Serilog.Formatting.Compact;
global using Serilog.Formatting.Display;
global using Serilog.Parsing;
1 change: 0 additions & 1 deletion EtLast.Diagnostics.HttpSender/DiagnosticsHttpSender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public class DiagnosticsHttpSender : IDisposable, IEtlContextListener
private readonly IEtlContext _context;
private ExtendedBinaryWriter _currentWriter;
private readonly ExtendedBinaryWriter _eventWriter = new(new MemoryStream(), Encoding.UTF8);
private readonly ExtendedBinaryWriter _dictWriter = new(new MemoryStream(), Encoding.UTF8);
private readonly object _currentWriterLock = new();
private bool _finished;
private int _communicationErrorCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.7.0">
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.7.0">
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,8 @@ private void ListView_MouseDoubleClick(object sender, MouseEventArgs e)
};

var control = new ProcessRowListControl(form, process, rows.Values.ToList());
control.Updater.RefreshStarted += (sender, args) =>
{
form.Text = "LOADING...";
};
control.Updater.RefreshFinished += (sender, args) =>
{
form.Text = "Process output: " + process.Name;
};
control.Updater.RefreshStarted += (sender, args) => form.Text = "LOADING...";
control.Updater.RefreshFinished += (sender, args) => form.Text = "Process output: " + process.Name;

ToolTipSingleton.Remove(ListView);
form.ShowDialog();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<ItemGroup>
<PackageReference Include="ObjectListView.Repack.Core3" Version="2.9.3" />
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.7.0">
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion EtLast.EPPlus/EtLast.EPPlus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<ItemGroup>
<PackageReference Include="EPPlus" Version="4.5.3.3" />
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.7.0">
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion EtLast.Hosting.AspNet/EtLast.Hosting.AspNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.7.0">
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion EtLast.Hosting/EtLast.Hosting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.7.0">
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 2 additions & 0 deletions EtLast.Hosting/Host/AbstractHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ private void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArg
var formattedMessage = ex.FormatExceptionWithDetails();

if (Logger != null)
{
Logger.Write(LogEventLevel.Fatal, "unexpected error during execution: {ErrorMessage}", formattedMessage);
}
else
{
Console.WriteLine("unexpected error during execution: " + formattedMessage);
Expand Down
20 changes: 10 additions & 10 deletions EtLast.Hosting/Logging/EtlContextDevToFileLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,39 @@ public EtlContextDevToFileLogger(string folder, LogSeverity minimumLogLevel, int
var config = new LoggerConfiguration()
.WriteTo.File(new Serilog.Formatting.Compact.CompactJsonFormatter(), Path.Combine(folder, "events-.json"),
restrictedToMinimumLevel: (LogEventLevel)minimumLogLevel,
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: infoFileCount,
buffered: true,
flushToDiskInterval: TimeSpan.FromSeconds(1),
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: infoFileCount,
encoding: Encoding.UTF8)

.WriteTo.File(Path.Combine(folder, "2-info-.txt"),
outputTemplate: "{Timestamp:HH:mm:ss.fff zzz} [{Level:u3}] {Message:l} {NewLine}{Exception}",
restrictedToMinimumLevel: LogEventLevel.Information,
outputTemplate: "{Timestamp:HH:mm:ss.fff zzz} [{Level:u3}] {Message:l} {NewLine}{Exception}",
formatProvider: CultureInfo.InvariantCulture,
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: infoFileCount,
encoding: Encoding.UTF8)

.WriteTo.File(Path.Combine(folder, "3-warning-.txt"),
outputTemplate: "{Timestamp:HH:mm:ss.fff zzz} [{Level:u3}] {Message:l} {NewLine}{Exception}",
restrictedToMinimumLevel: LogEventLevel.Warning,
outputTemplate: "{Timestamp:HH:mm:ss.fff zzz} [{Level:u3}] {Message:l} {NewLine}{Exception}",
formatProvider: CultureInfo.InvariantCulture,
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: importantFileCount,
encoding: Encoding.UTF8)

.WriteTo.File(Path.Combine(folder, "4-error-.txt"),
outputTemplate: "{Timestamp:HH:mm:ss.fff zzz} [{Level:u3}] {Message:l} {NewLine}{Exception}",
restrictedToMinimumLevel: LogEventLevel.Error,
outputTemplate: "{Timestamp:HH:mm:ss.fff zzz} [{Level:u3}] {Message:l} {NewLine}{Exception}",
formatProvider: CultureInfo.InvariantCulture,
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: importantFileCount,
encoding: Encoding.UTF8)

.WriteTo.File(Path.Combine(folder, "5-fatal-.txt"),
outputTemplate: "{Timestamp:HH:mm:ss.fff zzz} [{Level:u3}] {Message:l} {NewLine}{Exception}",
restrictedToMinimumLevel: LogEventLevel.Fatal,
outputTemplate: "{Timestamp:HH:mm:ss.fff zzz} [{Level:u3}] {Message:l} {NewLine}{Exception}",
formatProvider: CultureInfo.InvariantCulture,
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: importantFileCount,
Expand All @@ -57,10 +57,10 @@ public EtlContextDevToFileLogger(string folder, LogSeverity minimumLogLevel, int
restrictedToMinimumLevel: LogEventLevel.Debug,
outputTemplate: "{Timestamp:HH:mm:ss.fff zzz} [{Level:u3}] {Message:l} {NewLine}{Exception}",
formatProvider: CultureInfo.InvariantCulture,
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: lowFileCount,
buffered: true,
flushToDiskInterval: TimeSpan.FromSeconds(1),
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: lowFileCount,
encoding: Encoding.UTF8);
}

Expand All @@ -71,10 +71,10 @@ public EtlContextDevToFileLogger(string folder, LogSeverity minimumLogLevel, int
restrictedToMinimumLevel: LogEventLevel.Verbose,
outputTemplate: "{Timestamp:HH:mm:ss.fff zzz} [{Level:u3}] {Message:l} {NewLine}{Exception}",
formatProvider: CultureInfo.InvariantCulture,
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: lowFileCount,
buffered: true,
flushToDiskInterval: TimeSpan.FromSeconds(1),
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: lowFileCount,
encoding: Encoding.UTF8);
}

Expand Down
9 changes: 4 additions & 5 deletions EtLast.Hosting/Logging/EtlContextIoToFileLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public EtlContextIoToFileLogger(string folder, int lowFileCount = 4)
.WriteTo.File(Path.Combine(folder, "io-.tsv"),
outputTemplate: "{Timestamp:HH:mm:ss.fff zzz}\t{Message:l}{NewLine}",
formatProvider: CultureInfo.InvariantCulture,
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: lowFileCount,
buffered: true,
flushToDiskInterval: TimeSpan.FromSeconds(1),
hooks: new IoFileLifecycleHooks(),
encoding: Encoding.UTF8);
rollingInterval: RollingInterval.Day,
retainedFileCountLimit: lowFileCount,
encoding: Encoding.UTF8,
hooks: new IoFileLifecycleHooks());

_logger = config.CreateLogger();
}
Expand Down Expand Up @@ -155,7 +155,6 @@ public override Stream OnFileOpened(string path, Stream underlyingStream, Encodi
writer.Flush();
underlyingStream.Flush();
}

}

return base.OnFileOpened(path, underlyingStream, encoding);
Expand Down
2 changes: 1 addition & 1 deletion EtLast.LocalFiles/EtLast.LocalFiles.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.7.0">
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion EtLast.ServiceModel/EtLast.ServiceModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<ItemGroup>
<PackageReference Include="System.ServiceModel.Primitives" Version="8.0.0" />
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.7.0">
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion EtLast.Specialized/EtLast.Specialized.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.7.0">
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion EtLast/EtLast.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.7.0">
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.9.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ protected override IEnumerable<IRow> EvaluateImpl(Stopwatch netTimeStopwatch)
}

foreach (var row in groupRows)
(row as IRow).SetOwner(null);
(row as IRow)?.SetOwner(null);

foreach (var aggregate in aggregates)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ protected override IEnumerable<IRow> EvaluateImpl(Stopwatch netTimeStopwatch)
}

foreach (var groupRow in groupRows)
(groupRow as IRow).SetOwner(null);
(groupRow as IRow)?.SetOwner(null);

groupRows.Clear();

Expand Down Expand Up @@ -175,7 +175,7 @@ protected override IEnumerable<IRow> EvaluateImpl(Stopwatch netTimeStopwatch)
}

foreach (var groupRow in groupRows)
(groupRow as IRow).SetOwner(null);
(groupRow as IRow)?.SetOwner(null);

groupRows.Clear();

Expand Down
5 changes: 0 additions & 5 deletions EtLast/Mutators/ThrowExceptionOnRowErrorMutator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

public sealed class ThrowExceptionOnRowErrorMutator : AbstractMutator
{
protected override void StartMutator()
{
base.StartMutator();
}

protected override IEnumerable<IRow> MutateRow(IRow row, long rowInputIndex)
{
if (row.HasError())
Expand Down
Loading

0 comments on commit fdea44d

Please sign in to comment.