Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ charset = utf-8
indent_style = space
indent_size = 4
tab_width = 4
end_of_line = crlf
# LF on every platform, matching the `* text=auto eol=lf` default in .gitattributes.
# Overrides below must stay in step with the eol pins in that file.
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# .NET code files
[*.{cs,csx,cake,fs,fsx,vb,vbx}]
indent_style = tab

file_header_template = Copyright (c) ktsu.dev\nAll rights reserved.\nLicensed under the MIT license.
file_header_template = Copyright (c) 2023-2026 ktsu-dev contributors

# Default severity for all .NET Code Style rules
dotnet_analyzer_diagnostic.severity = error
Expand Down Expand Up @@ -503,4 +505,9 @@ indent_style = tab
# Shell scripts
[*.sh]
end_of_line = lf
indent_size = 2
indent_size = 2

# Windows batch scripts and Visual Studio solution files keep CRLF on every platform.
# These match the eol=crlf pins in .gitattributes.
[*.{cmd,bat,sln}]
end_of_line = crlf
23 changes: 14 additions & 9 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,25 @@
# Git Line Endings #
###############################

# Set default behaviour to automatically normalize line endings.
* text=auto
# Normalize all text files to LF in the repository, and check them out as LF on every
# platform. The explicit eol overrides each machine's core.autocrlf, so the working tree
# is byte-identical on Windows, Linux and macOS. This must stay in step with the
# end_of_line settings in .editorconfig.
* text=auto eol=lf

# csharp files to match .editorconfig
*.cs text eol=crlf
# Force bash scripts to always use LF line endings so that if a repo is accessed
# in Unix via a file share from Windows, the scripts will work. Redundant with the
# default above, kept explicit because these files break outright with CRLF.
*.sh text eol=lf

# Force batch scripts to always use CRLF line endings so that if a repo is accessed
# in Windows via a file share from Linux, the scripts will work.
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
*.cmd text eol=crlf
*.bat text eol=crlf

# Force bash scripts to always use LF line endings so that if a repo is accessed
# in Unix via a file share from Windows, the scripts will work.
*.sh text eol=lf
# Visual Studio rewrites solution files with CRLF regardless of the checkout, so pin
# them to avoid a spurious whole-file diff every time the solution is opened.
*.sln text eol=crlf

###############################
# Git Large File System (LFS) #
Expand Down
21 changes: 1 addition & 20 deletions .runsettings
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<!-- Specify a deterministic output directory -->
<RunConfiguration>
<ResultsDirectory>.\coverage</ResultsDirectory>
<ResultsDirectory>TestResults</ResultsDirectory>
</RunConfiguration>
<!-- Specify a deterministic output directory -->
<RunConfiguration>
<ResultsDirectory>.\coverage</ResultsDirectory>
</RunConfiguration>

<!-- Configuration for coverlet data collector -->
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="coverlet.collector.DataCollectors.CoverletInProcDataCollector, coverlet.collector, Version=6.0.4.0, Culture=neutral, PublicKeyToken=null">
<Configuration>
<Format>opencover</Format>
<OutputPath>coverage.opencover.xml</OutputPath>
<Exclude>[*Test*]*,[*Tests*]*</Exclude>
<ExcludeByFile>**/obj/**/*</ExcludeByFile>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
4 changes: 1 addition & 3 deletions FileDeduplicator/Deduplicator.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) ktsu.dev
// All rights reserved.
// Licensed under the MIT license.
// Copyright (c) 2023-2026 ktsu-dev contributors

namespace ktsu.FileDeduplicator;

Expand Down Expand Up @@ -44,7 +42,7 @@
long bytesReclaimed = 0;
List<string> errors = [];

foreach (DuplicateGroup group in duplicateGroups)

Check warning on line 45 in FileDeduplicator/Deduplicator.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Loop should be simplified by calling Select(group => group.Files))

Check warning on line 45 in FileDeduplicator/Deduplicator.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Loop should be simplified by calling Select(group => group.Files))

Check warning on line 45 in FileDeduplicator/Deduplicator.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Loop should be simplified by calling Select(group => group.Files))
{
AbsoluteFilePath keeper = SelectFileToKeep(group.Files);

Expand Down
4 changes: 1 addition & 3 deletions FileDeduplicator/FileHasher.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) ktsu.dev
// All rights reserved.
// Licensed under the MIT license.
// Copyright (c) 2023-2026 ktsu-dev contributors

namespace ktsu.FileDeduplicator;

Expand Down
4 changes: 1 addition & 3 deletions FileDeduplicator/FileScanner.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) ktsu.dev
// All rights reserved.
// Licensed under the MIT license.
// Copyright (c) 2023-2026 ktsu-dev contributors

namespace ktsu.FileDeduplicator;

Expand Down
4 changes: 1 addition & 3 deletions FileDeduplicator/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) ktsu.dev
// All rights reserved.
// Licensed under the MIT license.
// Copyright (c) 2023-2026 ktsu-dev contributors

namespace ktsu.FileDeduplicator;

Expand Down
4 changes: 1 addition & 3 deletions FileDeduplicator/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) ktsu.dev
// All rights reserved.
// Licensed under the MIT license.
// Copyright (c) 2023-2026 ktsu-dev contributors

[assembly: CLSCompliant(false)]
[assembly: System.Runtime.InteropServices.ComVisible(false)]
4 changes: 1 addition & 3 deletions FileDeduplicator/Verbs/BaseVerb.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) ktsu.dev
// All rights reserved.
// Licensed under the MIT license.
// Copyright (c) 2023-2026 ktsu-dev contributors

namespace ktsu.FileDeduplicator.Verbs;

Expand Down
4 changes: 1 addition & 3 deletions FileDeduplicator/Verbs/Deduplicate.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) ktsu.dev
// All rights reserved.
// Licensed under the MIT license.
// Copyright (c) 2023-2026 ktsu-dev contributors

namespace ktsu.FileDeduplicator.Verbs;

Expand Down
4 changes: 1 addition & 3 deletions FileDeduplicator/Verbs/DryRun.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) ktsu.dev
// All rights reserved.
// Licensed under the MIT license.
// Copyright (c) 2023-2026 ktsu-dev contributors

namespace ktsu.FileDeduplicator.Verbs;

Expand Down
4 changes: 1 addition & 3 deletions FileDeduplicator/Verbs/Menu.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) ktsu.dev
// All rights reserved.
// Licensed under the MIT license.
// Copyright (c) 2023-2026 ktsu-dev contributors

namespace ktsu.FileDeduplicator.Verbs;

Expand All @@ -17,7 +15,7 @@
[Verb("Menu", isDefault: true)]
internal sealed class Menu : BaseVerb<Menu>
{
internal override void Run(Menu options)

Check warning on line 18 in FileDeduplicator/Verbs/Menu.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Add a way to break out of this method's recursion.

Check warning on line 18 in FileDeduplicator/Verbs/Menu.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Add a way to break out of this method's recursion.

Check warning on line 18 in FileDeduplicator/Verbs/Menu.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Add a way to break out of this method's recursion.

Check warning on line 18 in FileDeduplicator/Verbs/Menu.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Add a way to break out of this method's recursion.
{
ScrollMenu scrollMenu = new()
{
Expand Down
4 changes: 1 addition & 3 deletions FileDeduplicator/Verbs/Scan.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) ktsu.dev
// All rights reserved.
// Licensed under the MIT license.
// Copyright (c) 2023-2026 ktsu-dev contributors

namespace ktsu.FileDeduplicator.Verbs;

Expand Down
4 changes: 1 addition & 3 deletions FileDeduplicator/Verbs/Stats.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright (c) ktsu.dev
// All rights reserved.
// Licensed under the MIT license.
// Copyright (c) 2023-2026 ktsu-dev contributors

namespace ktsu.FileDeduplicator.Verbs;

Expand Down Expand Up @@ -77,7 +75,7 @@

// Extension breakdown
Dictionary<string, int> extensionCounts = [];
foreach (DuplicateGroup group in duplicates)

Check warning on line 78 in FileDeduplicator/Verbs/Stats.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Loop should be simplified by calling Select(group => group.Files))

Check warning on line 78 in FileDeduplicator/Verbs/Stats.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Loop should be simplified by calling Select(group => group.Files))

Check warning on line 78 in FileDeduplicator/Verbs/Stats.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Loop should be simplified by calling Select(group => group.Files))
{
string ext = System.IO.Path.GetExtension(group.Files[0].WeakString);
if (string.IsNullOrEmpty(ext))
Expand Down
18 changes: 9 additions & 9 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
},
"msbuild-sdks": {
"MSTest.Sdk": "4.3.3",
"ktsu.Sdk": "2.18.0",
"ktsu.Sdk.ConsoleApp": "2.18.0",
"ktsu.Sdk.Tool": "2.18.0",
"ktsu.Sdk.App": "2.18.0",
"ktsu.Sdk.Windows": "2.18.0",
"ktsu.Sdk.Linux": "2.18.0",
"ktsu.Sdk.macOS": "2.18.0",
"ktsu.Sdk.iOS": "2.18.0",
"ktsu.Sdk.Android": "2.18.0"
"ktsu.Sdk": "2.21.1",
"ktsu.Sdk.ConsoleApp": "2.21.1",
"ktsu.Sdk.Tool": "2.21.1",
"ktsu.Sdk.App": "2.21.1",
"ktsu.Sdk.Windows": "2.21.1",
"ktsu.Sdk.Linux": "2.21.1",
"ktsu.Sdk.macOS": "2.21.1",
"ktsu.Sdk.iOS": "2.21.1",
"ktsu.Sdk.Android": "2.21.1"
},
"test": {
"runner": "Microsoft.Testing.Platform"
Expand Down