Skip to content

Commit

Permalink
Merge pull request #277 from WoWs-Builder-Team/development
Browse files Browse the repository at this point in the history
Update 2.3 (Desktop)
  • Loading branch information
floribe2000 authored Nov 10, 2023
2 parents c7c73a5 + ce27929 commit 73e0ebd
Show file tree
Hide file tree
Showing 290 changed files with 8,756 additions and 6,536 deletions.
14 changes: 7 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggesti
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
dotnet_style_qualification_for_event = false:suggestion
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_event = true:warning
dotnet_style_qualification_for_field = true:warning
dotnet_style_qualification_for_method = true:warning
dotnet_style_qualification_for_property = true:warning
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion

# ReSharper properties
Expand Down Expand Up @@ -82,9 +82,10 @@ resharper_place_field_attribute_on_same_line = false
resharper_trailing_comma_in_multiline_lists = true
resharper_use_indent_from_vs = false

resharper_razor_remove_this_qualifier = true

# ReSharper inspection severities
resharper_arrange_redundant_parentheses_highlighting = hint
resharper_arrange_this_qualifier_highlighting = hint
resharper_arrange_type_member_modifiers_highlighting = hint
resharper_arrange_type_modifiers_highlighting = hint
resharper_async_void_lambda_highlighting = suggestion
Expand Down Expand Up @@ -112,9 +113,8 @@ dotnet_diagnostic.rs2008.severity = none # Ignore analyzer release tracking
dotnet_diagnostic.sa0001.severity = none # Ignore disabled xml documentation
dotnet_diagnostic.sa1000.severity = none # Ignore missing space after "new"
dotnet_diagnostic.sa1009.severity = none # Ignore missing space after closing parenthesis
dotnet_diagnostic.sa1028.severity = none # Ignore trailing whitespace
dotnet_diagnostic.sa1100.severity = none # Ignore base. prefix if there is no local override
dotnet_diagnostic.sa1101.severity = none # Ignore missing this prefix for local calls
dotnet_diagnostic.sa1101.severity = warning # Ignore missing this prefix for local calls
dotnet_diagnostic.sa1122.severity = none # Don't force the use of string.Empty
dotnet_diagnostic.sa1124.severity = none # Allow the use of regions
dotnet_diagnostic.sa1127.severity = none # Generic constraints may share a line with other declarations
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/desktop-release-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
- release/desktop

jobs:
build-and-release:
build-and-test:
runs-on: windows-latest
name: Release build and version check
name: Release build and test

steps:
- uses: actions/checkout@v3
Expand All @@ -19,9 +19,9 @@ jobs:
with:
global-json-file: global.json
- name: Build application
run: dotnet build dirs.proj -c Release -p:ReleaseTest=true
run: dotnet build dirs.proj -c Release
- name: Test application
run: dotnet test dirs.proj --no-build -c Release -p:ReleaseTest=true --verbosity normal
run: dotnet test dirs.proj --no-build -c Release --verbosity normal

verify-squirrel-release:
runs-on: windows-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sonar-code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: pwsh
run: |
./.sonar/scanner/dotnet-sonarscanner begin /k:"WoWs-Builder-Team_WoWs-ShipBuilder" /o:"wows-builder-team" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="TestResults/*/*.xml"
./.sonar/scanner/dotnet-sonarscanner begin /k:"WoWs-Builder-Team_WoWs-ShipBuilder" /o:"wows-builder-team" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="TestResults/*/*.xml"
dotnet build dirs.proj -c Release --no-restore
dotnet test dirs.proj -c Release --no-build --collect:"XPlat Code Coverage;Format=opencover" --results-directory TestResults
./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
24 changes: 6 additions & 18 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Update 2.1
# Update 2.3

## Download and Install

Expand All @@ -12,25 +12,13 @@ Download [**WoWsShipBuilderSetup.exe**](https://github.com/WoWs-Builder-Team/WoW
<summary>Click to show release notes</summary>

### Additions
- Penetration values for AP bombs and rockets
- Display Krupp for AP projectiles
- Add checks to prevent corrupted builds to be loaded

### Changes
- Update penetration formula with the one reverse engineered by TTaro_
- Remove measurements units from grid headers in the ship comparison and add them to the cells
- Stats expanders now do not take extra vertical space when expanded
- Various other minor improvements
- Theme Rework: A complete overhaul for the existing app theme with new accent colors and an improved color palette
- The new theme follows the [Material Design](https://material.io/design) guidelines
- Better contrast for text and icons
- New accent colors for the app, the app is no longer just grey

### Bugfixes
- Fix AA Defense and ASW Expert consumable bonus not applying correctly
- Fix app crashing after language selection
- Fix scrolling in desktop settings dialog
- Fix stats column space distribution for subs
- Fix special ability description of some ships
- Various other minor fixes

### Known Issues
- None

</details>
</details>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using FluentAssertions;
using System.Text.Json;
using FluentAssertions;
using Microsoft.Extensions.Logging.Abstractions;
using Newtonsoft.Json;
using WoWsShipBuilder.DataStructures;
using WoWsShipBuilder.Features.Builds;

Expand Down Expand Up @@ -95,7 +95,7 @@ public void CreateBuildFromString_InvalidString_NoValidJson()

Func<Build> action = () => Build.CreateBuildFromString(input);

action.Should().ThrowExactly<FormatException>().WithInnerException<JsonSerializationException>();
action.Should().ThrowExactly<FormatException>().WithInnerException<JsonException>();
}

[Test]
Expand All @@ -105,7 +105,7 @@ public void CreateBuildFromString_InvalidString_EmptyObject()

Func<Build> action = () => Build.CreateBuildFromString(input);

action.Should().ThrowExactly<FormatException>().WithInnerException<JsonSerializationException>();
action.Should().ThrowExactly<FormatException>().WithInnerException<ArgumentNullException>();
}

[Test]
Expand Down
28 changes: 16 additions & 12 deletions WoWsShipBuilder.Common.Test/BuildTests/BuildStringCreation.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
using System.Text.RegularExpressions;
using System.Collections.Immutable;
using System.Text.RegularExpressions;
using FluentAssertions;
using WoWsShipBuilder.DataStructures;
using WoWsShipBuilder.Features.Builds;

namespace WoWsShipBuilder.Test.BuildTests;

[TestFixture]
public class BuildStringCreation
public partial class BuildStringCreation
{
private readonly Regex buildRegex = new(@"^(?<shipIndex>[^;]*);(?<modules>[A-Z0-9,]*);(?<upgrades>[A-Z0-9,]*);(?<captain>[A-Z0-9]+);(?<skills>[0-9,]*);(?<consumables>[A-Z0-9,]*);(?<signals>[A-Z0-9,]*);(?<version>\d+)(;(?<buildName>[^;]*))?$");
private readonly Regex buildRegex = BuildRegex();

[Test]
public void EmptyBuild_CreateShortString_ExpectedResult()
{
const string buildName = "test-build";
const string shipIndex = "PASC020";
string expectedString = $"{shipIndex};;;PCW001;;;;{Build.CurrentBuildVersion};{buildName}";
var build = new Build(buildName, shipIndex, Nation.Usa, new(), new(), new(), "PCW001", new(), new());
var expectedString = $"{shipIndex};;;PCW001;;;;{Build.CurrentBuildVersion};{buildName}";
var build = new Build(buildName, shipIndex, Nation.Usa, ImmutableArray<string>.Empty, ImmutableArray<string>.Empty, ImmutableArray<string>.Empty, "PCW001", ImmutableArray<int>.Empty, ImmutableArray<string>.Empty);

string result = build.CreateShortStringFromBuild();
var result = build.CreateShortStringFromBuild();

result.Should().Be(expectedString);
}
Expand All @@ -28,10 +29,10 @@ public void EmptyBuild_CreateShortStringWithBuildName_MatchesRegex()
{
const string buildName = "test-build";
const string shipIndex = "PASC020";
var build = new Build(buildName, shipIndex, Nation.Usa, new(), new(), new(), "PCW001", new(), new());
string buildString = build.CreateShortStringFromBuild();
var build = new Build(buildName, shipIndex, Nation.Usa, ImmutableArray<string>.Empty, ImmutableArray<string>.Empty, ImmutableArray<string>.Empty, "PCW001", ImmutableArray<int>.Empty, ImmutableArray<string>.Empty);
var buildString = build.CreateShortStringFromBuild();

var result = buildRegex.Match(buildString);
var result = this.buildRegex.Match(buildString);

result.Success.Should().BeTrue();
result.Length.Should().Be(buildString.Length);
Expand All @@ -45,10 +46,10 @@ public void EmptyBuild_CreateShortStringWithBuildName_MatchesRegex()
public void EmptyBuild_CreateShortStringWithoutBuildName_MatchesRegex()
{
const string shipIndex = "PASC020";
var build = new Build(string.Empty, shipIndex, Nation.Usa, new(), new(), new(), "PCW001", new(), new());
string buildString = build.CreateShortStringFromBuild();
var build = new Build(string.Empty, shipIndex, Nation.Usa, ImmutableArray<string>.Empty, ImmutableArray<string>.Empty, ImmutableArray<string>.Empty, "PCW001", ImmutableArray<int>.Empty, ImmutableArray<string>.Empty);
var buildString = build.CreateShortStringFromBuild();

var result = buildRegex.Match(buildString);
var result = this.buildRegex.Match(buildString);

result.Success.Should().BeTrue();
result.Length.Should().Be(buildString.Length);
Expand All @@ -57,4 +58,7 @@ public void EmptyBuild_CreateShortStringWithoutBuildName_MatchesRegex()
result.Groups["buildName"].Success.Should().BeTrue();
result.Groups["buildName"].Value.Should().BeEmpty();
}

[GeneratedRegex("^(?<shipIndex>[^;]*);(?<modules>[A-Z0-9,]*);(?<upgrades>[A-Z0-9,]*);(?<captain>[A-Z0-9]+);(?<skills>[0-9,]*);(?<consumables>[A-Z0-9,]*);(?<signals>[A-Z0-9,]*);(?<version>\\d+)(;(?<buildName>[^;]*))?$")]
private static partial Regex BuildRegex();
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class SortShipUpgrades
[Test]
public void SortShipUpgrades_SimpleUnsortedList()
{
var data = CreateUpgradeList();
var data = this.CreateUpgradeList();

var sortedData = ShipModuleHelper.GroupAndSortUpgrades(data);

Expand Down
Loading

0 comments on commit 73e0ebd

Please sign in to comment.