Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.7.0 #65

Merged
merged 18 commits into from
Mar 8, 2025
Merged
Show file tree
Hide file tree
Changes from 12 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
8 changes: 7 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -441,4 +441,10 @@ dotnet_naming_rule.parameters_rule.severity = warning
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
##########################################
##########################################

# CA1707: Identifiers should not contain underscores
dotnet_diagnostic.CA1707.severity = none

# IDE1006: Remove warning for underscores
dotnet_diagnostic.IDE1006.severity = none
12 changes: 8 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ jobs:
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Setup .NET 9
uses: actions/setup-dotnet@v1
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/develop-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Run Tests
run: dotnet test --configuration Release --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
run: dotnet test -m --configuration Release --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/master-build-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/master-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Run Tests
run: dotnet test --configuration Release --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3
run: dotnet test -m --configuration Release --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Setup .NET 8
- name: Setup .NET 9
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Run Tests
run: dotnet test
run: dotnet test -m
- name: Deploy NuGet Package
run: dotnet nuget push ../../Nhl.Api/Nhl.Api/Nhl.Api/bin/Release/*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
12 changes: 4 additions & 8 deletions Nhl.Api.Common/Exceptions/InvalidPlayerPositionException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@
/// <summary>
/// An exception for when a request is made to the Nhl.Api and the player/goalie position is invalid
/// </summary>
public class InvalidPlayerPositionException : Exception
/// <remarks>
/// An exception for when a request is made to the Nhl.Api and the player/goalie position is invalid
/// </remarks>
public class InvalidPlayerPositionException(string message) : Exception(message)

Check warning on line 10 in Nhl.Api.Common/Exceptions/InvalidPlayerPositionException.cs

View check run for this annotation

Codecov / codecov/patch

Nhl.Api.Common/Exceptions/InvalidPlayerPositionException.cs#L10

Added line #L10 was not covered by tests
{
/// <summary>
/// An exception for when a request is made to the Nhl.Api and the player/goalie position is invalid
/// </summary>
public InvalidPlayerPositionException(string message) : base(message)
{

}
}
12 changes: 4 additions & 8 deletions Nhl.Api.Common/Exceptions/InvalidSeasonException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@
/// <summary>
/// An exception when the season year entered is not a valid NHL season
/// </summary>
public class InvalidSeasonException : Exception
/// <remarks>
/// An exception when the season year entered is not a valid NHL season
/// </remarks>
public class InvalidSeasonException(string message) : Exception(message)

Check warning on line 10 in Nhl.Api.Common/Exceptions/InvalidSeasonException.cs

View check run for this annotation

Codecov / codecov/patch

Nhl.Api.Common/Exceptions/InvalidSeasonException.cs#L10

Added line #L10 was not covered by tests
{
/// <summary>
/// An exception when the season year entered is not a valid NHL season
/// </summary>
public InvalidSeasonException(string message) : base(message)
{

}
}
14 changes: 14 additions & 0 deletions Nhl.Api.Common/Exceptions/InvalidTeamAbbreviationException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;

namespace Nhl.Api.Common.Exceptions;

/// <summary>
/// This exception is thrown when an invalid team abbreviation is used
/// </summary>
public class InvalidTeamAbbreviationException(string message) : Exception

Check warning on line 8 in Nhl.Api.Common/Exceptions/InvalidTeamAbbreviationException.cs

View check run for this annotation

Codecov / codecov/patch

Nhl.Api.Common/Exceptions/InvalidTeamAbbreviationException.cs#L8

Added line #L8 was not covered by tests
{
/// <summary>
/// The exception message
/// </summary>
public override string Message => message;

Check warning on line 13 in Nhl.Api.Common/Exceptions/InvalidTeamAbbreviationException.cs

View check run for this annotation

Codecov / codecov/patch

Nhl.Api.Common/Exceptions/InvalidTeamAbbreviationException.cs#L13

Added line #L13 was not covered by tests
}
12 changes: 4 additions & 8 deletions Nhl.Api.Common/Exceptions/NhlApiRequestException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@
/// <summary>
/// An exception for a failed Nhl.Api HTTP request
/// </summary>
public class NhlApiRequestException : Exception
/// <remarks>
/// An exception for a failed Nhl.Api HTTP request
/// </remarks>
public class NhlApiRequestException(string message) : Exception(message)

Check warning on line 10 in Nhl.Api.Common/Exceptions/NhlApiRequestException.cs

View check run for this annotation

Codecov / codecov/patch

Nhl.Api.Common/Exceptions/NhlApiRequestException.cs#L10

Added line #L10 was not covered by tests
{
/// <summary>
/// An exception for a failed Nhl.Api HTTP request
/// </summary>
public NhlApiRequestException(string message) : base(message)
{

}
}
2 changes: 1 addition & 1 deletion Nhl.Api.Common/Extensions/EnumExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static class EnumExtensions
/// <typeparam name="T">The enumeration type</typeparam>
/// <param name="value">The value of the enumerations</param>
/// <returns>The string value of the enumeration based on the attribute <see cref="EnumMemberAttribute"/></returns>
public static string GetEnumMemberValue<T>(this T value) where T : Enum => typeof(T)
public static string? GetEnumMemberValue<T>(this T value) where T : Enum => typeof(T)
.GetTypeInfo()
.DeclaredMembers
.SingleOrDefault(x => x.Name == value.ToString())
Expand Down
6 changes: 3 additions & 3 deletions Nhl.Api.Common/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ public static class StringExtensions
public static string ReplaceNonAsciiWithAscii(this string input)
{
// Define a regular expression pattern for non-ASCII characters
string pattern = @"[^\x00-\x7F]";
var pattern = @"[^\x00-\x7F]";

// Replace non-ASCII characters with their ASCII equivalents
string output = Regex.Replace(input, pattern, (match) =>
var output = Regex.Replace(input, pattern, (match) =>
{
char c = match.Value[0];
var c = match.Value[0];
return c switch
{
'À' or 'Á' or 'Â' or 'Ã' or 'Ä' => "A",
Expand Down
Loading
Loading