-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 #16991
Conversation
…and updated rules.
#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
- IDE0057 substring simplified Specific warnings for Umbraco.Tests.Benchmarks
…raco.Tests.Common
Fixed: - SA1111, SA1116, SA117 params and line formatting (not all as there are many) - SA1122 string.Empty - IDE0057 simplify substring - IDE0044,IDE0044 make field readonly - IDE1006 naming rule violation (add _) - SA1111 closing parenthesis on line of last parameter - SA1649 filename match type name - SA1312,SA1306 lowercase variable and field names
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:
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 🤖 🙂 |
- SA1649 file name match type name - SA111 parenthesis on line of last parameter - IDE0028 simplify collection initializer - SA1306 lower-case letter field - IDE044 readonly field - SA1122 string.Empty - SA1116 params same line - IDE1006 upper casing - IDE0041 simplify null check Updated the following projects to only list their remaining specific warning codes: - Umbraco.Tests.UnitTests Typo in `Umbraco.Web.Website` project
And I will also look at this one when you are finished with it 😺 |
Fixed various warnings where they are more straight-forward, including: - SA1111/SA1116/SA1119 parenthesis - SA1117 params - SA1312 lowercase variable - SA1121 built-in type - SA1500/SA1513/SA1503 formatting braces - SA1400 declare access modifier - SA1122 string.Empty - SA1310 no underscore - IDE0049 name simplified - IDE0057 simplify substring - IDE0074 compound assignment - IDE0032 use auto-property - IDE0037 simplify member name - IDE0008 explicit type not var - IDE0016/IDE0270/IDE0041 simplify null checks - IDE0048/SA1407 clarity in arithmetic - IDE1006 correct param names - IDE0042 deconstruct variable - IDE0044 readonly - IDE0018 inline variable declarations - IDE0074/IDE0054 compound assignment - IDE1006 naming - CS1573 param XML - CS0168 unused variable Comment formatting in project files for consistency. Updated all projects to only list remaining specific warning codes as warnings instead of errors (errors is now default).
@georgebid think I'm finished with this so far, but I won't publish till the other is merged since I branched off that one (fewer files to read!). Some Codescene warnings are because the files got bigger due to formatting changes etc. |
@emmagarland The other is merged now so feel free to edit and let me know when this one is ready to be looked at 😸 |
@georgebid Coolio, thanks, I'll let you know when it's all ready! 😃 |
@georgebid I've now merged from Again, Codescene is not happy that I've increased the length of things by updating the formatting according to the Stylecop guidelines etc, but I don't think that can be helped at this stage. It would also be good to know what you get for number of warnings on this branch (and possibly Let me know if any questions! |
Hey @emmagarland, I have just built and run all fine - I am seeing 10066 warnings in my solution, which seems to be a few more than you, does that still feel like a decrease from before? I tried a clean and build a couple of times too but yeah, 10066 for me! I'm happy to merge though if you're happy with that! |
Thanks @georgebid ; that sounds like it's the right number, I think my build is just not updating the number as there are many! Hopefully now they won't be added to as we reduce more errors/warnings. If you're happy to merge feel free to go for it - thanks so much! |
Prerequisites
Continuing on from #16990
If there's an existing issue for this PR then this fixes some of #15015
Description
Updated all projects to only list remaining specific warning codes as warnings instead of errors (errors is now default).
Fixed various warnings where they are more straight-forward, including:
Comment formatting in project files for consistency.
To test, ensure solution builds, tests and runs as expected. Worth scanning the files changes to ensure no likely issues I've not considered.
Currently seeing 8617 solution-wide warnings (this needs verification)