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>
2 changes: 0 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.14.2" />
<PackageVersion Include="Microsoft.Testing.Extensions.CrashDump" Version="1.7.2" />
<PackageVersion Include="Microsoft.Testing.Extensions.Fakes" Version="17.14.1" />
<PackageVersion Include="Microsoft.Testing.Extensions.HangDump" Version="1.7.2" />
<PackageVersion Include="Microsoft.Testing.Extensions.HotReload" Version="1.7.2" />
<PackageVersion Include="Microsoft.Testing.Extensions.Retry" Version="1.7.2" />
<PackageVersion Include="Microsoft.Testing.Extensions.TrxReport" Version="1.7.2" />
<PackageVersion Include="Polyfill" Version="11.0.2" />
<PackageVersion Include="System.Text.Json" Version="10.0.10" />
</ItemGroup>
Expand Down
4 changes: 1 addition & 3 deletions Navigation.Test/NavigationStackTests.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: Microsoft.VisualStudio.TestTools.UnitTesting.Parallelize(Scope = Microsoft.VisualStudio.TestTools.UnitTesting.ExecutionScope.MethodLevel)]

Expand Down
4 changes: 1 addition & 3 deletions Navigation/Contracts/INavigationItem.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.Navigation.Contracts;

Expand Down
4 changes: 1 addition & 3 deletions Navigation/Contracts/INavigationStack.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.Navigation.Contracts;

Expand Down
4 changes: 1 addition & 3 deletions Navigation/Contracts/IPersistenceProvider.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.Navigation.Contracts;

Expand Down Expand Up @@ -49,7 +47,7 @@
/// Represents the state of a navigation stack that can be persisted
/// </summary>
/// <typeparam name="T">The type of navigation items</typeparam>
public interface INavigationState<T> where T : class, INavigationItem

Check warning on line 50 in Navigation/Contracts/IPersistenceProvider.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Add the 'out' keyword to parameter 'T' to make it 'covariant'.

Check warning on line 50 in Navigation/Contracts/IPersistenceProvider.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Add the 'out' keyword to parameter 'T' to make it 'covariant'.

Check warning on line 50 in Navigation/Contracts/IPersistenceProvider.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add the 'out' keyword to parameter 'T' to make it 'covariant'.

See more on https://sonarcloud.io/project/issues?id=ktsu-dev_Navigation&issues=AZ_wBLBEwlUjSxwSMQED&open=AZ_wBLBEwlUjSxwSMQED&pullRequest=33
{
/// <summary>
/// Gets the items in the navigation stack
Expand Down
4 changes: 1 addition & 3 deletions Navigation/Contracts/IUndoRedoProvider.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.Navigation.Contracts;

Expand Down
4 changes: 1 addition & 3 deletions Navigation/Contracts/NavigationEventArgs.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.Navigation.Contracts;

Expand Down
4 changes: 1 addition & 3 deletions Navigation/Models/NavigationItem.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.Navigation.Models;

Expand Down
4 changes: 1 addition & 3 deletions Navigation/Models/NavigationState.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.Navigation.Models;

Expand Down
4 changes: 1 addition & 3 deletions Navigation/Services/InMemoryPersistenceProvider.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.Navigation.Services;

Expand Down
4 changes: 1 addition & 3 deletions Navigation/Services/JsonFilePersistenceProvider.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.Navigation.Services;

Expand Down
4 changes: 1 addition & 3 deletions Navigation/Services/NavigateToAction.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.Navigation.Services;

Expand Down
4 changes: 1 addition & 3 deletions Navigation/Services/NavigationStack.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.Navigation.Services;

Expand Down
4 changes: 1 addition & 3 deletions Navigation/Services/NavigationStackFactory.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.Navigation.Services;

Expand Down Expand Up @@ -39,7 +37,7 @@
/// <param name="persistenceProvider">The persistence provider to use</param>
/// <returns>A new navigation stack instance</returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "<Pending>")]
public INavigation<T> CreateNavigationStack<T>(IUndoRedoProvider? undoRedoProvider, IPersistenceProvider<T>? persistenceProvider) where T : class, INavigationItem => new Navigation<T>(undoRedoProvider, persistenceProvider);

Check warning on line 40 in Navigation/Services/NavigationStackFactory.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Make 'CreateNavigationStack' a static method.

Check warning on line 40 in Navigation/Services/NavigationStackFactory.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Make 'CreateNavigationStack' a static method.

Check warning on line 40 in Navigation/Services/NavigationStackFactory.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make 'CreateNavigationStack' a static method.

See more on https://sonarcloud.io/project/issues?id=ktsu-dev_Navigation&issues=AZ_wBLFCwlUjSxwSMQEH&open=AZ_wBLFCwlUjSxwSMQEH&pullRequest=33

/// <summary>
/// Creates a new navigation stack with only an undo/redo provider
Expand All @@ -48,7 +46,7 @@
/// <param name="undoRedoProvider">The undo/redo provider to use</param>
/// <returns>A new navigation stack instance</returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "<Pending>")]
public INavigation<T> CreateNavigationStack<T>(IUndoRedoProvider undoRedoProvider) where T : class, INavigationItem => new Navigation<T>(undoRedoProvider);

Check warning on line 49 in Navigation/Services/NavigationStackFactory.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Make 'CreateNavigationStack' a static method.

Check warning on line 49 in Navigation/Services/NavigationStackFactory.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Make 'CreateNavigationStack' a static method.

Check warning on line 49 in Navigation/Services/NavigationStackFactory.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make 'CreateNavigationStack' a static method.

See more on https://sonarcloud.io/project/issues?id=ktsu-dev_Navigation&issues=AZ_wBLFCwlUjSxwSMQEG&open=AZ_wBLFCwlUjSxwSMQEG&pullRequest=33

/// <summary>
/// Creates a new navigation stack with only a persistence provider
Expand All @@ -64,5 +62,5 @@
/// <typeparam name="T">The type of navigation items</typeparam>
/// <returns>A new navigation stack instance</returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "<Pending>")]
public INavigation<T> CreateBasicNavigationStack<T>() where T : class, INavigationItem => new Navigation<T>();

Check warning on line 65 in Navigation/Services/NavigationStackFactory.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make 'CreateBasicNavigationStack' a static method.

See more on https://sonarcloud.io/project/issues?id=ktsu-dev_Navigation&issues=AZ_wBLFCwlUjSxwSMQEI&open=AZ_wBLFCwlUjSxwSMQEI&pullRequest=33
}
4 changes: 1 addition & 3 deletions Navigation/Services/SimpleUndoRedoProvider.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.Navigation.Services;

Expand Down Expand Up @@ -71,7 +69,7 @@
return false;
}

IUndoableAction action = _undoStack.Last();

Check warning on line 72 in Navigation/Services/SimpleUndoRedoProvider.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Indexing at Count-1 should be used instead of the "Enumerable" extension method "Last"

Check warning on line 72 in Navigation/Services/SimpleUndoRedoProvider.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Indexing at Count-1 should be used instead of the "Enumerable" extension method "Last"

Check warning on line 72 in Navigation/Services/SimpleUndoRedoProvider.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Indexing at Count-1 should be used instead of the "Enumerable" extension method "Last"

See more on https://sonarcloud.io/project/issues?id=ktsu-dev_Navigation&issues=AZ_wBLEvwlUjSxwSMQEE&open=AZ_wBLEvwlUjSxwSMQEE&pullRequest=33
_undoStack.RemoveAt(_undoStack.Count - 1);

try
Expand All @@ -97,7 +95,7 @@
return false;
}

IUndoableAction action = _redoStack.Last();

Check warning on line 98 in Navigation/Services/SimpleUndoRedoProvider.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Indexing at Count-1 should be used instead of the "Enumerable" extension method "Last"

Check warning on line 98 in Navigation/Services/SimpleUndoRedoProvider.cs

View workflow job for this annotation

GitHub Actions / Build, Test & Release

Indexing at Count-1 should be used instead of the "Enumerable" extension method "Last"

Check warning on line 98 in Navigation/Services/SimpleUndoRedoProvider.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Indexing at Count-1 should be used instead of the "Enumerable" extension method "Last"

See more on https://sonarcloud.io/project/issues?id=ktsu-dev_Navigation&issues=AZ_wBLEwwlUjSxwSMQEF&open=AZ_wBLEwwlUjSxwSMQEF&pullRequest=33
_redoStack.RemoveAt(_redoStack.Count - 1);

try
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