Skip to content

style: enforce IDE0090 and use var for simplifiable new expressions - #521

Merged
currantw merged 3 commits into
valkey-io:mainfrom
currantw:cleanup_simplify-construction
Aug 12, 2026
Merged

style: enforce IDE0090 and use var for simplifiable new expressions#521
currantw merged 3 commits into
valkey-io:mainfrom
currantw:cleanup_simplify-construction

Conversation

@currantw

@currantw currantw commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

In an effort to increase code style consistency, enforces the IDE0090 analyzer rule ("'new' expression can be simplified")
as an error and normalizes the affected declarations on var.

Issue Link

⚪ None.

Features and Behaviour Changes

No behavioural changes. This is a code-style change only.

  • IDE0090 is now enforced as an error.
  • Explicit-type local declarations (Type x = new Type(...)) are rewritten as
    var x = new Type(...) across the test projects.

Implementation

  • .editorconfig — set csharp_style_implicit_object_creation_when_type_is_apparent = true:error.
  • Applied the rule — converted all 82 explicit-type local declarations.

Limitations

⚪ None.

Testing

task lint:csharp passes

Related Issues

⚪ None.

Checklist

  • This Pull Request is related to one issue. (no associated issue)
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated and all checks pass.
  • CHANGELOG.md, README.md, DEVELOPER.md, and other documentation files are updated. (no docs impact)
  • Destination branch is correct - main or release
  • Create merge commit if merging release branch into main, squash otherwise.

- Set IDE0090 (simplify 'new' expression) to error via the
  csharp_style_implicit_object_creation_when_type_is_apparent option.
- Convert explicit-type local declarations to var across the test
  projects to satisfy IDE0090.
- Fix pre-existing IDE0005 (redundant using) and IDE0028 (collection
  initialization) violations in TestUtils that the new Lint gate surfaced.

Signed-off-by: currantw <taylor.curran@improving.com>
Signed-off-by: currantw <taylor.curran@improving.com>
@currantw currantw self-assigned this Aug 12, 2026
@currantw
currantw requested a balanced review from Copilot August 12, 2026 14:30
@currantw currantw added the dev Internal changes like cleanup, refactoring, or developer tools. label Aug 12, 2026
Comment thread .gitignore
@currantw
currantw merged commit da2b3d3 into valkey-io:main Aug 12, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev Internal changes like cleanup, refactoring, or developer tools.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants