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

Resolved more warnings, and marked more warning types as errors #16990

Merged
merged 5 commits into from
Sep 10, 2024

Conversation

emmagarland
Copy link
Contributor

@emmagarland emmagarland commented Sep 1, 2024

Prerequisites

  • I have added steps to test this contribution in the description below

If there's an existing issue for this PR then this fixes some of #15015

Description

Fixed various warnings where they are more straight-forward, including:

  • IDE0270 null check can be simplified
  • CS0105 namespace appeared already
  • CS0162 remove unreachable code
  • SA1028 remove trailing whitespace
  • SA1106 no empty statements
  • CS1570 malformed XML
  • CS1572 corrected xml parameter
  • CS1573 param tag added
  • IDE0007 var not explicit
  • IDE0008 explicit not var
  • IDE0057 simplify substring
  • IDE0074 compound assignment
  • CA1825 array.empty

Suppressed the following warnings until code required is implemented:

  • #pragma warning disable CS0162 // Unreachable code detected
  • #pragma warning disable CS0618 // Type or member is obsolete

Updated the following projects to only list their remaining specific warning codes:

  • Umbraco.Web.Website

Down to 3479 warnings.

Stopped at 50 files for review to avoid code getting too out of sync with new commits.

To test, ensure solution builds, tests and runs as expected. Worth scanning the files changes to ensure no likely issues I've not considered.

Copy link

github-actions bot commented Sep 1, 2024

Hi there @emmagarland, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

#pragma warning disable CS0162 // Unreachable code detected
#pragma warning disable CS0618 // Type or member is obsolete

CS0162 remove unreachable code
SA1028 remove trailing whitespace
SA1106 no empty statements
CS1570 malformed XML
CS1572 corrected xml parameter
CS1573 param tag added
IDE0007 var not explicit
IDE0008 explicit not var
IDE0057 simplify substring
IDE0074 compound assignment
CA1825 array.empty

Down to 3479 warnings
@emmagarland emmagarland marked this pull request as ready for review September 1, 2024 15:48
@emmagarland emmagarland added community/pr category/dx Developer experience labels Sep 1, 2024
@emmagarland emmagarland changed the title Chore/15015 Resolved more warnings (part of overall goal warnings as errors in #15015) Sep 1, 2024
@georgebid
Copy link
Contributor

Nice "Chore" PR @emmagarland, I'll aim to take a look at this one soon 😄

@georgebid georgebid self-assigned this Sep 2, 2024
@emmagarland
Copy link
Contributor Author

Fab, thanks @georgebid!

@emmagarland emmagarland changed the title Resolved more warnings (part of overall goal warnings as errors in #15015) Resolved more warnings, and marked more warning types as errors Sep 2, 2024
@georgebid georgebid merged commit 862820c into umbraco:contrib Sep 10, 2024
14 checks passed
@georgebid
Copy link
Contributor

Hey, @emmagarland I've checked through this one + built and all looks good to me! Therefore I have gone ahead and merged it 🚀

@emmagarland
Copy link
Contributor Author

Amazing @georgebid, thankyou!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category/dx Developer experience community/pr
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants