Skip to content

style: Multiple low-severity style violations across the codebase #49

Description

@jaybarden1

Aggregated low-severity style violations

These are individually small but collectively degrade code consistency and will generate warnings (→ errors with TreatWarningsAsErrors=true).

1. XML <param name="ct"> mismatch — CS1572 compile error

IAccountRepository, ISyncRepository, IFileClassificationRuleRepository, WorkspaceViewModel.LoadPersistedAccountsAsync: Every method documents the cancellation parameter as <param name="ct"> but the actual signatures use cancellationToken. With TreatWarningsAsErrors=true this is a compile error (CS1572).

Fix: Replace all <param name="ct"> with <param name="cancellationToken"> across those files.

2. Missing sealed on classes that should not be inherited

  • WorkspaceViewModelpublic sealed class WorkspaceViewModel
  • AccountViewModelpublic sealed class AccountViewModel
  • FolderNodepublic sealed class FolderNode
  • Programinternal static sealed class Program

3. return not preceded by blank line in AuthService catch blocks

Three catch blocks (lines ~38, 43, 68) have a return statement on the line immediately following the log call, with no blank line between. Per convention, every return after a code block must be preceded by a blank line.

Fix (for each): add a blank line before the return.

4. BuildAvaloniaApp() missing XML <summary> and <returns>

Program.cs:14: public static AppBuilder BuildAvaloniaApp() is public with no XML docs.

5. ConfigureAwait(false) missing on multiple awaits

  • AccountOnboardingService.cs — final await on the MatchAsync chain
  • AddAccountWizardViewModel.cs — three service-layer await calls
  • App.axaml.cs — four await calls in InitialiseAsync and ApplyDatabaseMigrationsAsync
  • WorkspaceViewModel.csawait _accountRepository.GetAllAsync(...)

Add .ConfigureAwait(false) on each.

6. XML summary comments that restate the code (banned "what" comments)

  • Auth/AccountId.cs: factory method summary speculates about future validation. Replace with a terse contract statement.
  • Auth/AccountProfile.cs: same pattern.
  • Auth/AuthError.cs/Auth/AuthResult.cs: check for similar.

7. AccountProfileFactory class missing <summary>

Auth/AccountProfile.cs:8: the factory class itself has no XML <summary>.

Rule reference

@.claude/rules/c-sharp-code-style.md — XML Documentation, Classes and Methods, naming

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions