Skip to content

Commit

Permalink
Merge pull request #23 from CDEApp/chore/lint
Browse files Browse the repository at this point in the history
task: Lint and package bump
  • Loading branch information
jafin authored Sep 9, 2023
2 parents 38425e3 + 8a56777 commit fd6d70c
Show file tree
Hide file tree
Showing 20 changed files with 45 additions and 48 deletions.
2 changes: 1 addition & 1 deletion build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Build.Locator" Version="1.5.5" />
<PackageReference Include="Nuke.Common" Version="7.0.2" />
<PackageReference Include="Nuke.Common" Version="7.0.5" />
<PackageDownload Include="GitVersion.Tool" Version="[5.6.7]" />
</ItemGroup>

Expand Down
1 change: 1 addition & 0 deletions src/cde.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<s:Boolean x:Key="/Default/UserDictionary/Words/=includefiles/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=includefolders/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mediatr/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=msec/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=msecs/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=pnull/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Rect/@EntryIndexedValue">True</s:Boolean>
Expand Down
8 changes: 4 additions & 4 deletions src/cde/cde.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="7.0.1" />
<PackageReference Include="Autofac" Version="7.1.0" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="JetBrains.Annotations" Version="2023.2.0" />
<PackageReference Include="MediatR" Version="12.1.0" />
<PackageReference Include="MediatR.Extensions.Autofac.DependencyInjection" Version="11.0.0" />
<PackageReference Include="MediatR" Version="12.1.1" />
<PackageReference Include="MediatR.Extensions.Autofac.DependencyInjection" Version="11.2.0" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.63">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -31,7 +31,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="7.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="7.0.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="SerilogTimings" Version="3.0.1" />
<PackageReference Include="Spectre.Console" Version="0.47.0" />
Expand Down
8 changes: 4 additions & 4 deletions src/cdeLib/cdeLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="7.0.1" />
<PackageReference Include="Autofac" Version="7.1.0" />
<PackageReference Include="AutofacSerilogIntegration" Version="5.0.0" />
<PackageReference Include="Dawn.Guard" Version="1.12.0" />
<PackageReference Include="FlatSharp" Version="6.3.5" />
<PackageReference Include="FlatSharp.Runtime" Version="7.1.1" />
<PackageReference Include="FlatSharp.Runtime" Version="7.2.3" />
<PackageReference Include="JetBrains.Annotations" Version="2023.2.0" />
<PackageReference Include="MediatR" Version="12.1.0" />
<PackageReference Include="MediatR.Extensions.Autofac.DependencyInjection" Version="11.0.0" />
<PackageReference Include="MediatR" Version="12.1.1" />
<PackageReference Include="MediatR.Extensions.Autofac.DependencyInjection" Version="11.2.0" />
<PackageReference Include="MessagePack" Version="2.5.124" />
<PackageReference Include="MessagePack.Annotations" Version="2.5.124" />
<PackageReference Include="MessagePackAnalyzer" Version="2.5.124">
Expand Down
4 changes: 2 additions & 2 deletions src/cdeLibTest/cdeLibTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="MurmurHash.Net" Version="0.0.2" />
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
Expand Down
13 changes: 7 additions & 6 deletions src/cdeWin/CDEWinForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Windows.Forms;
using cdeLib;
using cdeLib.Entities;
using cdeWin.Cfg;
using Util;

namespace cdeWin;
Expand Down Expand Up @@ -178,7 +179,7 @@ private void RegisterClientEvents()
ItemActivate = () => OnSearchResultListViewItemActivate(),
ColumnClick = () => OnSearchResultListViewColumnClick(),
// ReSharper restore PossibleNullReferenceException
ContextMenu = CreateSearchResultContextMenu(),
ContextMenu = CreateSearchResultContextMenu()
};

DirectoryListViewHelper = new ListViewHelper<ICommonEntry>(directoryListView)
Expand All @@ -189,7 +190,7 @@ private void RegisterClientEvents()
ColumnClick = () => OnDirectoryListViewColumnClick(),
ItemSelectionChanged = () => OnDirectoryListViewItemSelectionChanged(),
// ReSharper restore PossibleNullReferenceException
ContextMenu = CreateDirectoryContextMenu(),
ContextMenu = CreateDirectoryContextMenu()
};

directoryTreeView.BeforeExpand += DirectoryTreeViewOnBeforeExpand;
Expand Down Expand Up @@ -342,7 +343,7 @@ private ContextMenuStrip CreateDirectoryTreeContextMenu()
//CopyFullNameHandler = (s, e) => (),
ParentHandler = (s, e) => OnDirectoryContextMenuParentClick(),
// ReSharper restore PossibleNullReferenceException
CancelOpeningEventHandler = DirectoryTreeContextMenuOpening,
CancelOpeningEventHandler = DirectoryTreeContextMenuOpening
};

return menuHelper.GetContextMenuStrip();
Expand Down Expand Up @@ -389,7 +390,7 @@ private ContextMenuStrip CreateDirectoryContextMenu()
CopyFullNameHandler = (s, e) => OnDirectoryContextMenuCopyFullPathClick(),
ParentHandler = (s, e) => OnDirectoryContextMenuParentClick(),
// ReSharper restore PossibleNullReferenceException
CancelOpeningEventHandler = (s, e) => DirectoryListViewHelper.SearchListContextMenuOpening(s, e),
CancelOpeningEventHandler = (s, e) => DirectoryListViewHelper.SearchListContextMenuOpening(s, e)
};
return menuHelper.GetContextMenuStrip();
}
Expand All @@ -408,7 +409,7 @@ private ContextMenuStrip CreateSearchResultContextMenu()
//CopyBaseNameHandler = (s, e) => (),
CopyFullNameHandler = (s, e) => OnSearchResultContextMenuCopyFullPathClick(),
// ReSharper restore PossibleNullReferenceException
CancelOpeningEventHandler = (s, e) => SearchResultListViewHelper.SearchListContextMenuOpening(s, e),
CancelOpeningEventHandler = (s, e) => SearchResultListViewHelper.SearchListContextMenuOpening(s, e)
};
return menuHelper.GetContextMenuStrip();
}
Expand Down Expand Up @@ -508,7 +509,7 @@ public void SetSearchTimeStatus(string s)
{
if (searchTimeStatus.Text.Equals(s)) return;
searchTimeStatus.Text = s;
this.mainStatusStrip.Update(); //Added since it is not updating this automagically.
mainStatusStrip.Update(); //Added since it is not updating this automagically.
}

public void SetSearchTextBoxAutoComplete(IEnumerable<string> history)
Expand Down
9 changes: 5 additions & 4 deletions src/cdeWin/CDEWinFormPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using cdeLib;
using cdeLib.Entities;
using cdeLib.Infrastructure;
using cdeWin.Cfg;

namespace cdeWin;

Expand Down Expand Up @@ -310,7 +311,7 @@ public void Search()
ToHourEnable = _clientForm.ToHour.Checked,
ToHour = _clientForm.ToHourValue.TimeOfDay,
NotOlderThanEnable = _clientForm.NotOlderThan.Checked,
NotOlderThan = NotOlderThanValue(),
NotOlderThan = NotOlderThanValue()
};

var param = new BgWorkerParam
Expand Down Expand Up @@ -411,13 +412,13 @@ protected string OptimiseRegexPattern(string pattern)
changeMade = false;
if (pattern.StartsWith(".*"))
{
pattern = pattern.Substring(2);
pattern = pattern[2..];
changeMade = true;
}

if (pattern.EndsWith(".*"))
{
pattern = pattern.Substring(0, pattern.Length - 2);
pattern = pattern[..^2];
changeMade = true;
}
} while (changeMade);
Expand Down Expand Up @@ -1035,7 +1036,7 @@ private int RootCompare(RootEntry re1, RootEntry re2)
var compareResult = column switch
{
0 => re1.Path.CompareTo(re2.Path),
1 => string.Compare((string.IsNullOrEmpty(re1.VolumeName) ? "" : re1.VolumeName), string.IsNullOrEmpty(re2.VolumeName) ? "": re2.VolumeName, StringComparison.Ordinal),
1 => string.Compare(string.IsNullOrEmpty(re1.VolumeName) ? "" : re1.VolumeName, string.IsNullOrEmpty(re2.VolumeName) ? "": re2.VolumeName, StringComparison.Ordinal),
2 => re1.DirEntryCount.CompareTo(re2.DirEntryCount),
3 => re1.FileEntryCount.CompareTo(re2.FileEntryCount),
4 => (re1.DirEntryCount + re1.FileEntryCount).CompareTo(re2.DirEntryCount + re2.FileEntryCount),
Expand Down
17 changes: 10 additions & 7 deletions src/cdeWin/Cfg/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
using System.IO;
using System.Linq;
using System.Windows.Forms;
using ProtoBuf;
using cdeLib;
using cdeLib.Entities;
using ProtoBuf;

namespace cdeWin;
namespace cdeWin.Cfg;

[ProtoContract]
public class WindowConfig
Expand Down Expand Up @@ -171,8 +171,11 @@ public class Configuration

public interface IConfig : IConfigCdeLib
{
// ReSharper disable once InconsistentNaming
string DateFormatYMDHMS { get; }
// ReSharper disable once InconsistentNaming
string DateCustomFormatYMD { get; }
// ReSharper disable once InconsistentNaming
string DateCustomFormatHMS { get; }
string LinkRepository { get; }
Configuration Active { get; set; }
Expand Down Expand Up @@ -222,7 +225,7 @@ public class Config : IConfig
new() { Name="Size", Width=90, Alignment = HorizontalAlignment.Right },
new() { Name="Modified", Width=130},
new() { Name="Catalog", Width=130},
new() { Name="Path", Width=400},
new() { Name="Path", Width=400}
}
},
DirectoryListView = new ListViewConfig
Expand All @@ -231,7 +234,7 @@ public class Config : IConfig
{
new() { Name="Name", Width=260},
new() { Name="Size", Width=90, Alignment = HorizontalAlignment.Right },
new() { Name="Modified", Width=130 },
new() { Name="Modified", Width=130 }
}
},
CatalogListView = new ListViewConfig
Expand All @@ -250,7 +253,7 @@ public class Config : IConfig
new() { Name="Created", Width=130 },
new() { Name="Scan Time", Width=70, Alignment = HorizontalAlignment.Right},
new() { Name="Catalog File", Width=150 },
new() { Name="Description", Width=150 },
new() { Name="Description", Width=150 }
}
},
DirectoryPaneSplitterRatio = -1f,
Expand All @@ -261,7 +264,7 @@ public class Config : IConfig
FromSizeDropDownIndex = -1, // initial default value is set by win forms configuration code
ToSizeDropDownIndex = -1, // initial default value is set by win forms configuration code
NotOlderThanDropDownIndex = -1, // initial default value is set by win forms configuration code
PatternHistoryMaximum = 50,
PatternHistoryMaximum = 50
};

public Configuration Loaded;
Expand Down Expand Up @@ -407,7 +410,7 @@ private static DateTime DateOrNow(DateTime dateValue)
return dateValue;
}

public List<ColumnConfig> RestoreColumnConfig(ListViewConfig initial, ListViewConfig active)
private static IEnumerable<ColumnConfig> RestoreColumnConfig(ListViewConfig initial, ListViewConfig active)
{
var columnMismatch = false;
if (initial.Columns.Count == active.Columns.Count)
Expand Down
1 change: 1 addition & 0 deletions src/cdeWin/ColumnHeaderCollectionExtension.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using cdeWin.Cfg;

namespace cdeWin;

Expand Down
1 change: 1 addition & 0 deletions src/cdeWin/DoubleBufferListView.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Windows.Forms;
using cdeWin.Cfg;

namespace cdeWin;

Expand Down
19 changes: 0 additions & 19 deletions src/cdeWin/EnumerableStringExtensions.cs

This file was deleted.

1 change: 1 addition & 0 deletions src/cdeWin/ListViewHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using cdeWin.Cfg;

namespace cdeWin;
// think about making Presenter<> look for all members that implement IPresenterHelper
Expand Down
1 change: 1 addition & 0 deletions src/cdeWin/LoadCatalogService.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using Util;
using cdeLib.Entities;
using cdeWin.Cfg;
using Serilog;

namespace cdeWin;
Expand Down
1 change: 1 addition & 0 deletions src/cdeWin/LoaderForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using Util;
using cdeLib.Catalog;
using cdeLib.Entities;
using cdeWin.Cfg;
using Dawn;
using Serilog;

Expand Down
1 change: 1 addition & 0 deletions src/cdeWin/MyAboutBox.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Diagnostics;
using System.Windows.Forms;
using cdeWin.Cfg;

namespace cdeWin;

Expand Down
1 change: 1 addition & 0 deletions src/cdeWin/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.IO;
using System.Threading;
using System.Windows.Forms;
using cdeWin.Cfg;
using Microsoft.Extensions.Configuration;
using Serilog;

Expand Down
1 change: 1 addition & 0 deletions src/cdeWinTest/CDEWinFormPresenterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using cdeLib.Entities;
using cdeLib.Infrastructure.Config;
using cdeWin;
using cdeWin.Cfg;
using JetBrains.Annotations;
using NUnit.Framework;
using Util;
Expand Down
1 change: 1 addition & 0 deletions src/cdeWinTest/TestCDEWinPresenterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using cdeLib.Entities;
using cdeLib.Infrastructure.Config;
using cdeWin;
using cdeWin.Cfg;
using NSubstitute;

namespace cdeWinTest;
Expand Down
1 change: 1 addition & 0 deletions src/cdeWinTest/TestCDEWinPresenter_OptimiseRegexPattern.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using NUnit.Framework;
using cdeWin;
using cdeWin.Cfg;

namespace cdeWinTest;

Expand Down
2 changes: 1 addition & 1 deletion src/cdeWinTest/cdeWinTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2023.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
Expand Down

0 comments on commit fd6d70c

Please sign in to comment.