Skip to content

Commit bf09f1e

Browse files
committed
Ignore IDE0039 affecting rcheevos.cs, hide BHI1005, and add docs
1 parent 0808bed commit bf09f1e

4 files changed

Lines changed: 8 additions & 2 deletions

File tree

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ csharp_indent_switch_labels = true
1212
csharp_indent_case_contents = true
1313
csharp_indent_labels = one_less_than_current
1414

15+
# Style rules
16+
dotnet_diagnostic.IDE0039.severity = none
17+
1518
# Globalization rules
1619
dotnet_code_quality.CA1305.excluded_symbol_names = T:System.Byte|T:System.SByte|T:System.Int16|T:System.UInt16|T:System.Int32|T:System.UInt32|T:System.Int64|T:System.UInt64|T:System.String|T:System.Text.StringBuilder|T:System.Convert
1720

Common.ruleset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<Rule Id="BHI1004" Action="Error" />
1515

1616
<!-- Default branch of switch expression should throw InvalidOperationException/SwitchExpressionException or not throw -->
17-
<Rule Id="BHI1005" Action="Error" />
17+
<Rule Id="BHI1005" Action="Hidden" />
1818

1919
<!-- Do not discard local variables -->
2020
<Rule Id="BHI1006" Action="Error" />

contributing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ It's probably a good idea to get the .NET SDK, even if you're not working on a .
7676

7777
For EmuHawk and libraries in the main solution, which do not target .NET 6, we have [this page](https://github.com/TASEmulators/BizHawk/wiki/Available-C%23-and-.NET-features) documenting which features are actually available to use.
7878

79+
### Code Analysis
7980

81+
Visual Studio can detect and show issues and possible optimizations in the IDE before build time. In the Analyze menu pick Run Code Analysis -> On Solution. From there you can open the Error list in the bottom left and highlight issues of different severity level Errors/Warnings/Messages and adjust the scope as small as the open documents and as wide as the entire solution. Developers should target to have no code introduced flagging the Error and Warning levels. It's also good to minimize warnings at the Message severity level either by adopting the suggested fixes or by ignoring irrelevant Messages with `#pragma` directives. Many warnings can be auto-fixed by the `dotnet format` command or by the quick actions menu found on the left next to a line number when hovering a line.
8082

8183
## blip_buf
8284
> Audio resampling library.

src/BizHawk.Client.EmuHawk/RetroAchievements/RCheevos.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,8 @@ public override void Restart()
414414

415415
// validate addresses now that we have cheevos init
416416
// ReSharper disable once ConvertToLocalFunction
417-
bool peekcb(int address) => _readMap.ContainsKey(address);
417+
LibRCheevos.rc_runtime_validate_address_t peekcb = address => _readMap.ContainsKey(address);
418+
418419
_lib.rc_runtime_validate_addresses(_runtime, _eventcb, peekcb);
419420

420421
_gameInfoForm.Restart(_gameData.Title, _gameData.TotalCheevoPoints(HardcoreMode), CurrentRichPresence ?? "N/A");

0 commit comments

Comments
 (0)