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

Update code style #27

Merged
merged 10 commits into from
Nov 26, 2021
Merged

Update code style #27

merged 10 commits into from
Nov 26, 2021

Conversation

Zastai
Copy link
Owner

@Zastai Zastai commented Nov 26, 2021

This includes

  • file-scoped namespaces
  • target-typed new
  • new braces style (i.e. braces even when contents span a single line)
  • Rider processing:
    • Code cleanup
    • Resolve all inspections
  • Canonical null checks (is [not] null, ??)
  • Lines wrapped at column 132

This also adds a previously-omitted Languages property to IWork.

Wrap at column 132; mostly comments and string literals.
For `null`, `true` and `false`.
Rider sadly does not use the diagnostic ID specified on `[Obsolete]`,
so it still complains about `WebRequest`. So disable the `CS0618`
compiler message for now as well.
This was present on the underlying object but never exposed.
This also disables the "property can be made init-only" and "use
deconstruction" inspections, because the resulting code does not
compile for all targets.
They will now all be `is null` or `is not null`, instead of mixing
`== null`, `!= null`, `object.ReferenceEquals(..., null)` and
`.HasValue`.
This also drops all uses of `GetValueOrDefault` in favour of `??`.
@Zastai Zastai merged commit 9772066 into main Nov 26, 2021
@Zastai Zastai deleted the update-code-style branch November 26, 2021 20:37
@Zastai Zastai added feature A new feature or API was added (requires a bump of the minor version) maintenance Internal changes that do not impact functionality or API labels Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature or API was added (requires a bump of the minor version) maintenance Internal changes that do not impact functionality or API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant