Commit Graph

187 Commits

Author SHA1 Message Date
YoshiRulz e89ba513c0
Add Analyzer to suggest `span.IsEmpty` over `span.Length is 0` 2025-08-08 13:57:50 +10:00
YoshiRulz d9a42ff3db
Add Analyzer to ban `override bool Equals(object?)` on `ref struct`s
It's pointless to call this method, and when you omit it the compiler
tries to emit a call to the base method which is a simple build error.
Also ban overriding `GetHashCode`, because I don't think that's useful
outside of hash tables (which you obvously can't use ref structs in),
and implementing one without the other is a bad practice anyway and will
be picked up by another Analyzer.
2025-08-08 13:57:43 +10:00
YoshiRulz 4b4a0d27dd
Simplify `ReflectionCacheGenerator` by reading `$(RootNamespace)` prop 2025-08-08 13:39:54 +10:00
YoshiRulz 0743a1f8ea
Add Analyzer for banning `init;` props
turns out you can write to `readonly` fields from these, which is a
convention I'm not willing to break
2025-07-30 03:35:45 +10:00
YoshiRulz f89949520e
Fix code style warnings in iso-parser
fixes 5de736af0, 7df0cef0d
2025-07-30 03:35:09 +10:00
YoshiRulz 35ce3f56c5
Fix `NoTargetTypedThrowAnalyzer` choking on `throw obj.AField;` 2025-07-13 17:11:00 +10:00
Morilli f6c027f10e NLua: remove this[string field] overloads on LuaTable and LuaUserData
- closes #4387

Those overloads try to imitate lua's "a.b" parsing by navigating tables recursively, e.g. `table["a.b"]` == `table.a.b`. This is not what's intended by 100% of the use cases of these overloads, so I've removed them.
2025-07-07 18:26:54 +02:00
Morilli e4cf5d2955 fix virtu keyboard serialization
- closes #4392
2025-07-07 15:21:44 +02:00
YoshiRulz 701ef1e960
NLua: Implement `IReadOnlyDictionary<object, object>` on `LuaTable` 2025-06-17 03:33:12 +10:00
YoshiRulz e5d641fc09
Fix `ReflectionCacheGenerator` choking on dummy projects 2025-05-21 10:50:35 +10:00
YoshiRulz 3df637ab84
Migrate `BizHawk.SrcGen.*` to `IIncrementalGenerator` 2025-05-16 18:29:59 +10:00
YoshiRulz f656f07bfe
A couple refactors for `RoslynUtils` and `DefaultSetterGenerator` 2025-04-24 04:51:48 +10:00
YoshiRulz ca0ddeffef
Improve highlight locations of some BizHawk.Analyzer diagnostics 2025-03-20 07:35:47 +10:00
CasualPokePlayer 38f8e3a9b4 Add Void Linux liblua naming method
Yes, it's actually named liblua5.4.so.5.4
2025-03-15 01:53:12 -07:00
CasualPokePlayer 05722664e0 Throw Lua errors on lua cothread they were done on (instead of the main cothread)
Fixes #4252
2025-03-01 22:29:55 -08:00
YoshiRulz 8d71c8a505
Add Analyzer for suggesting adding `checked` operators 2025-02-22 17:07:35 +10:00
YoshiRulz 507b30a1dc
Use global imports in Analyzer projects 2025-02-22 11:15:18 +10:00
YoshiRulz de1a7b1e30
Use `SpecialType` where possible in BizHawk.Analyzer 2025-01-31 17:52:49 +10:00
YoshiRulz af32948756
Add Analyzer to warn about LINQ calls on string receivers 2025-01-31 14:49:40 +10:00
YoshiRulz a3901f66e5
Add Analyzer to require `class`/`struct` keyword on records
fixes eef190d33, e8c957a7a, and c68dd703d
2024-10-19 04:53:35 +10:00
YoshiRulz 97a8e9011e
Add Analyzer to warn about decimal<=>float/double casts
fixes c882fe4ea and 32a66a955
2024-09-17 03:02:09 +10:00
YoshiRulz 6dbee180e9
Fix typo in `TernaryInferredTypeMismatchAnalyzer`
fixes fa361ce06
2024-09-17 00:53:41 +10:00
YoshiRulz fa361ce06c
Add Analyzer for finding errors with ternaries in interpolated strings
why is this not part of the SDK
2024-09-14 02:44:08 +10:00
YoshiRulz c09f195148
Fix bug in `HawkSourceAnalyzer` 2024-07-12 23:27:29 +10:00
YoshiRulz 5fd840e145
Add Analyzer (currently disabled) for target-typed `new` with `throw` 2024-07-09 00:12:46 +10:00
YoshiRulz 2a5d4b903c
Add Analyzer to disallow `^= true` 2024-07-08 10:39:06 +10:00
YoshiRulz 2ffb897b11
Add analyzer (currently disabled) to enforce a newline policy for `=>` 2024-07-07 15:32:31 +10:00
YoshiRulz 479f151bbb
Fix code style warnings in satellite .NET projects 2024-07-07 12:54:11 +10:00
YoshiRulz 2534c9288e
Downgrade Roslyn to 4.8.0 (to continue supporting earliest .NET 8 SDK)
partially reverts 4d1e852d2
2024-07-02 06:49:11 +10:00
YoshiRulz 867b560a1d
Fix BHI3300 being raised twice for offending accessors 2024-07-02 05:59:31 +10:00
YoshiRulz 4d1e852d2d
Bump Roslyn and testing deps 2024-07-02 05:59:31 +10:00
YoshiRulz 3490b544b4
Have About dialog copy full Git commit hash to clipboard
and use full hash in GitHub web app URI
2024-06-20 04:01:58 +10:00
YoshiRulz b5ff65f2cb
Add Analyzer to enforce spaces in `[]` 2024-05-30 15:51:20 +10:00
YoshiRulz ea15126fe1
Minor refactors to first-party Analyzers and Source Generators 2024-05-30 09:22:18 +10:00
YoshiRulz b8c600783a
Apply `<GenerateDocumentationFile/>` to satellite .NET projects 2024-05-30 09:22:17 +10:00
YoshiRulz 431b4f67e8
Fix most remaining warnings in satellite .NET projects 2024-05-30 09:22:11 +10:00
Morilli 48479145af revert this change in Virtu to fix the build 2024-05-29 10:35:44 +02:00
Morilli 7a789fb853 Fix some external project analyzer warnings 2024-05-29 09:41:53 +02:00
CasualPokePlayer 06ceec6390 Fixup nyma flatbuffer comms, update flatbuffer 2024-04-27 02:52:14 -07:00
Morilli fd36a37f17 Fix BizHawk.Analyzer potentially throwing
Co-Authored-By: James Groom <13409956+YoshiRulz@users.noreply.github.com>
2024-04-20 17:01:59 +02:00
Morilli b10f8969ac Don't allocate extra buffers in lua [Push|To]String 2024-03-19 12:19:56 +01:00
CasualPokePlayer 33a512235a Fix NRE for lua cothreads
fixes ba24907d9c
2023-11-17 19:46:59 -08:00
CasualPokePlayer ba24907d9c Improve NLua lua library loading, using C# function pointers. It now no longer depends on BizHawk.BizInvoke/BizHawk.Common. It might be faster too
Add in liblua-* variant for Linux lua library names (resolves #3678)
Remove some more unused NLua code
Make LuaState internal, we don't need to see it (NLua.Lua API slightly changed to accommodate this, tests could be broken due to this?)
Make various other NLua classes internal, we don't need to see them
Check against lua library loading failing, provide a non-fatal message box if it has failed instead of crashing on some exception.
Remove UnixSearchPaths (unneeded with LD_LIBRARY_PATH being set) and unused IImportResolvers
2023-11-17 19:03:03 -08:00
CasualPokePlayer cef72bef4b try to fix crashes under Mono when calling a cached function with the wrong arguments 2023-11-16 09:08:20 -08:00
CasualPokePlayer 582446651f fix all the analyser warnings in NLua 2023-11-16 03:14:47 -08:00
CasualPokePlayer 00e0a5fb2a fix default value arrays source generation
this change doesn't actually do anything since we don't even have arrays in default values
2023-10-25 22:55:46 -07:00
CasualPokePlayer f2a4794105 Use source generation for SettingsUtil.SetDefaultValues 2023-10-25 22:52:06 -07:00
Morilli 71e08e27b9 bump AnalysisModePerformance to Recommended
fixes CA1841

silence CA1805 and CA1822 because of sheer amount of violations

reduce severity of CA1838 because I don't wanna fix it lol
2023-08-14 14:18:45 -07:00
Morilli 8e557b0b9d bump AnalysisModeGlobalization to Recommended
fixes CA1304, CA1309, CA1310, CA1311

temporarily silences CA1305

reduce severity of CA2101
2023-08-14 14:18:45 -07:00
CasualPokePlayer bb96825c60
System.Data.SQLite -> Microsoft.Data.Sqlite (#3719)
* Swap System.Data.SQLite with Microsoft.Data.Sqlite

Apparently this is supposed to be a kind of successor? https://learn.microsoft.com/en-us/dotnet/standard/data/sqlite/compare

* Add e_sqlite3 libs to Assets, prevent runtimes folder creation with OS tailored libs plopped in, delete System.Data.SQLite references
2023-08-05 17:45:40 -07:00