Commit 28294b9
Resolve Most Compiler Warnings (#1870)
* Temporarily disable nullability and XML warnings
* How many times does `dotnet format` need to be ran...
* Collection Expressions - int[] numbers = []
* CA1836: Prefer IsEmpty over Count when available
* IDE0004: Cast is redundant
* IDE0074: Use compound assignment
* CA1510: Use ArgumentNullException throw helper
* CA1829: Use Length/Count property instead of Enumerable.Count method
* IDE0063: Using statement can be simplified
* CA1826: Use property instead of Linq Enumerable method
* CA1512: Use ArgumentOutOfRangeException throw helper
* IDE0070: 'GetHashCode' implementation can be simplified
* IDE0057: Substring can be simplified
* IDE0056: Indexing can be simplified
* IDE0251: Member can be made 'readonly'
* CA1854: Prefer the IDictionary.TryGetValue(TKey, out TValue) method
* IDE1006: Naming rule violation: Missing suffix: 'Async'
* Split different namespaces/class into separate files
* IDE0090: 'new' expression can be simplified
* CA1866: Use 'string.StartsWith(char)' instead of 'string.StartsWith(string)' when you have a string with a single char
* CS9191: The 'ref' modifier for argument 2 corresponding to 'in' parameter is equivalent to 'in'. Consider using 'in' instead.
* CS0108: 'ThreadChannelEditModel.Flags' hides inherited member 'ChannelEditModel.Flags'. Use the new keyword if hiding was intended.
* CA1860: Prefer comparing 'Length' to 0 rather than using 'Any()', both for clarity and for performance
* CA2208: Instantiate argument exceptions correctly
* CA2017: Number of parameters supplied in the logging message template do not match the number of named placeholders
* CA2253: Named placeholders in the logging message template should not be comprised of only numeric characters
* IDE0059: Unnecessary assignment of a value to '{0}'
* CS0168: The variable 'guild' is declared but never used
* CA1827: Do not use Count()/LongCount() when Any() can be used
* CA2021: Type 'Newtonsoft.Json.Linq.JToken' is incompatible with type 'string' and cast attempts will throw InvalidCastException at runtime
* CA1853: Do not guard 'Dictionary.Remove(key)' with 'Dictionary.ContainsKey(key)'
* CA1822: Mark members as static
* SYSLIB1045: Use 'GeneratedRegexAttribute' to generate the regular expression implementation at compile-time.
* IDE0250: Struct can be made 'readonly'
* CA1834: Use 'StringBuilder.Append(char)' instead of 'StringBuilder.Append(string)' when the input is a constant unit string
* CA1806: '{0}' calls '{1}' but does not use the value the method returns. Linq methods are known to not have side effects. Use the result in a conditional statement, assign the result to a variable, or pass it as an argument to another method.
* CA1068: Method '{0}' should take CancellationToken as the last parameter
* IDE0051: Private member '{0}' is unused
* Namespaces below the usings
* Except for OrDefault methods, CA1826: Use property instead of Linq Enumerable method
* `dotnet format`
* IDE0052: Private member '{0}' can be removed as the value assigned to it is never read
* CA2254: The logging message template should not vary between calls to 'LoggerExtensions.LogCritical(ILogger, Exception?, string?, params object?[])'
* SYSLIB1054: Mark the method '{0}' with 'LibraryImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
* CA1835: Change the 'ReadAsync' method call to use the 'Stream.ReadAsync(Memory<byte>, CancellationToken)' overload
* CA1859: Change type of property '{0}' from '{1}' to '{2}' for improved performance
* CA1825: Avoid unnecessary zero-length array allocations. Use Array.Empty<byte>() instead.
* IDE0051: Remove unread private members
* Minor optimization
* Resolve CA1067 and CS0659
* Resolve CA1816
* refactor: Formatting go boom
* IDE0220: 'foreach' statement implicitly converts 'object' to 'System.Text.RegularExpressions.Match'. Add an explicit cast to make intent clearer, as it may fail at runtime
* CA2012: ValueTask instances should not have their result directly accessed unless the instance has already completed. Unlike Tasks, calling Result or GetAwaiter().GetResult() on a ValueTask is not guaranteed to block until the operation completes. If you can't simply await the instance, consider first checking its IsCompleted property (or asserting it's true if you know that to be the case).
* Resolve IDE0060
* Re-enable XML doc warnings
* CS1572: XML comment has a param tag for '{0}', but there is no parameter by that name
* Resolve CS1574
* CS1573
* No compiler warnings!
* Reenable nullability
* Sort WarningsNotAsErrors
* Fix triple newlines
* IDE0078: Use pattern matching
---------
Co-authored-by: Velvet <42438262+VelvetToroyashi@users.noreply.github.com>1 parent 6382c0c commit 28294b9
731 files changed
Lines changed: 2819 additions & 2911 deletions
File tree
- DSharpPlus.CommandsNext
- Attributes
- Converters
- Entities
- Builders
- EventArgs
- Exceptions
- Executors
- DSharpPlus.Commands
- ArgumentModifiers
- FromCode
- ContextChecks
- ParameterChecks
- Converters
- EventArgs
- Exceptions
- Invocation
- Processors
- BaseCommandProcessor
- MessageCommands
- SlashCommands
- ArgumentModifiers
- Localization
- Metadata
- TextCommands
- ContextChecks
- Parsing
- UserCommands
- Trees
- Metadata
- DSharpPlus.Interactivity
- Enums
- EventHandling
- ComponentBased
- Requests
- Requests
- Extensions
- DSharpPlus.Lavalink
- Entities
- Enums
- EventArgs
- DSharpPlus.Rest
- DSharpPlus.SlashCommands
- Attributes
- Built-in Checks
- Contexts
- EventArgs
- DSharpPlus.Tests/Commands
- Cases
- Commands
- Processors/TextCommands/Parsing
- Trees
- DSharpPlus.VoiceNext
- Codec
- Entities
- EventArgs
- DSharpPlus
- AsyncEvents
- Clients
- Entities
- Application
- AuditLogs
- Entries
- AutoModeration
- Action
- Channel
- Message
- Embed
- Poll
- Overwrite
- Stage
- Thread
- Forum
- Color
- Emoji
- Guild
- ScheduledEvents
- Widget
- Integration
- Interaction
- Application
- Components
- Selects
- Metadata
- Permissions
- Invite
- User
- Voice
- Webhook
- EventArgs
- AutoModeration
- Channel
- Thread
- Guild
- Ban
- Member
- Role
- ScheduledEvents
- Integration
- Interaction
- Invite
- Message
- Reaction
- Socket
- Stage Instance
- User
- Voice
- Exceptions
- Logging
- Metrics
- Net
- Abstractions
- Gateway
- Rest
- Transport
- Models
- Rest
- Serialization
- Udp
- WebSocket
- tools
- AutoUpdateChannelDescription
- DSharpPlus.Tools.CodeBlockLanguageListGen
- DSharpPlus.Tools.ShardedEventHandlingGen
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
25 | 35 | | |
26 | 36 | | |
27 | 37 | | |
| |||
147 | 157 | | |
148 | 158 | | |
149 | 159 | | |
150 | | - | |
| 160 | + | |
151 | 161 | | |
152 | 162 | | |
153 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
| |||
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | | - | |
14 | 11 | | |
15 | 12 | | |
16 | 13 | | |
| |||
25 | 22 | | |
26 | 23 | | |
27 | 24 | | |
28 | | - | |
29 | 25 | | |
30 | 26 | | |
31 | 27 | | |
32 | | - | |
33 | 28 | | |
34 | 29 | | |
35 | 30 | | |
36 | 31 | | |
37 | | - | |
| 32 | + | |
38 | 33 | | |
39 | 34 | | |
40 | | - | |
41 | 35 | | |
42 | 36 | | |
43 | 37 | | |
44 | 38 | | |
45 | 39 | | |
46 | | - | |
| 40 | + | |
47 | 41 | | |
48 | 42 | | |
49 | 43 | | |
| 44 | + | |
| 45 | + | |
50 | 46 | | |
51 | 47 | | |
52 | 48 | | |
| |||
0 commit comments