Skip to content

NFC-154 Deprecations, warning fixes and using formatter#69

Open
SanderKondratjevNortal wants to merge 10 commits intoweb-eid-mobilefrom
NFC-154
Open

NFC-154 Deprecations, warning fixes and using formatter#69
SanderKondratjevNortal wants to merge 10 commits intoweb-eid-mobilefrom
NFC-154

Conversation

@SanderKondratjevNortal
Copy link
Copy Markdown

Signed-off-by: Sander KondratjevSander.Kondratjev@Nortal.com

configuration.SiteOrigin = origin;
if (logger?.IsEnabled(LogLevel.Debug) == true)
{
#pragma warning disable CA1848
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's either disable or at least downgrade CA1848 repo-wide in .editorconfig:

dotnet_diagnostic.CA1848.severity = suggestion # or none

Then let's remove CA1848 pragmas.

Alternative is to use source-generated logging:

internal static partial class LogMessages
{
      [LoggerMessage(EventId = 1001, Level = LogLevel.Debug, Message = "Origin set to {origin}")]
      public static partial void OriginSet(this ILogger logger, String origin);
}

Then call logger?.OriginSet(configuration.SiteOrigin).

But this might be too large effort.

{
#pragma warning disable CA1848
logger?.LogError(ex, "Error occurred while downloading user container file");
#pragma warning disable CA1848
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo:

Suggested change
#pragma warning disable CA1848
#pragma warning restore CA1848

But let's get rid of CA1848, see previous comment.

if (payload.signatureAlgorithm && typeof payload.signatureAlgorithm === "string") {
payload.signatureAlgorithm = {
id: payload.signatureAlgorithm,
name: payload.signatureAlgorithm
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct structure? SignatureDto is

SignatureDto
    required SignatureAlgorithmDto SignatureAlgorithm
      required string CryptoAlgorithm
      required string HashFunction
      required string PaddingScheme

dotnet build --configuration Release --no-restore src/WebEid.Security.sln
dotnet test src/WebEid.Security.sln --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover --results-directory "TestResults"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="$env:SONAR_TOKEN"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add dotnet format --verify-no-changes for format verification as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants