|
| 1 | +root = true |
| 2 | + |
| 3 | +[*.cs] |
| 4 | +indent_style = space |
| 5 | +indent_size = 3 |
| 6 | +end_of_line = crlf |
| 7 | +insert_final_newline = true |
| 8 | +charset = utf-8-bom |
| 9 | +trim_trailing_whitespace = true |
| 10 | + |
| 11 | +# Security/correctness rules are kept as errors. |
| 12 | +# The rules below are downgraded because they would require sweeping |
| 13 | +# rewrites unrelated to the current focus (architecture, security and |
| 14 | +# performance). They can be tightened back to errors progressively. |
| 15 | + |
| 16 | +# Style/design suggestions: keep visible (suggestion) but not breaking. |
| 17 | +dotnet_diagnostic.CA1003.severity = suggestion # EventHandler<T> with EventArgs |
| 18 | +dotnet_diagnostic.CA1008.severity = suggestion # Enums should have zero value |
| 19 | +dotnet_diagnostic.CA1024.severity = suggestion # Use properties where appropriate |
| 20 | +dotnet_diagnostic.CA1032.severity = suggestion # Implement standard exception ctors |
| 21 | +dotnet_diagnostic.CA1056.severity = suggestion # Uri properties should not be strings |
| 22 | +dotnet_diagnostic.CA1030.severity = suggestion # Make method an event |
| 23 | +dotnet_diagnostic.CA1031.severity = suggestion # Do not catch general Exception |
| 24 | +dotnet_diagnostic.CA1034.severity = suggestion # Nested types should not be visible |
| 25 | +dotnet_diagnostic.CA1051.severity = suggestion # Do not declare visible instance fields |
| 26 | +dotnet_diagnostic.CA1062.severity = suggestion # Validate arguments of public methods |
| 27 | +dotnet_diagnostic.CA1303.severity = none # Localised string literal |
| 28 | +dotnet_diagnostic.CA1304.severity = suggestion # ToLower without culture |
| 29 | +dotnet_diagnostic.CA1305.severity = suggestion # IFormatProvider missing |
| 30 | +dotnet_diagnostic.CA1307.severity = suggestion # StringComparison missing |
| 31 | +dotnet_diagnostic.CA1308.severity = suggestion # ToLowerInvariant vs ToUpperInvariant |
| 32 | +dotnet_diagnostic.CA1310.severity = suggestion # StartsWith without StringComparison |
| 33 | +dotnet_diagnostic.CA1311.severity = suggestion # Specify culture for ToLower/ToUpper |
| 34 | +dotnet_diagnostic.CA1707.severity = suggestion # Underscore in identifiers |
| 35 | +dotnet_diagnostic.CA1716.severity = suggestion # Reserved language identifier |
| 36 | +dotnet_diagnostic.CA1805.severity = suggestion # Default value initialization |
| 37 | +dotnet_diagnostic.CA1810.severity = suggestion # Init static fields inline |
| 38 | +dotnet_diagnostic.CA1812.severity = suggestion # Avoid uninstantiated internal class |
| 39 | +dotnet_diagnostic.CA1815.severity = suggestion # Override Equals on value types |
| 40 | +dotnet_diagnostic.CA1819.severity = suggestion # Properties should not return arrays |
| 41 | +dotnet_diagnostic.CA1822.severity = suggestion # Mark members static |
| 42 | +dotnet_diagnostic.CA1859.severity = suggestion # Use concrete types for performance |
| 43 | +dotnet_diagnostic.CA1862.severity = suggestion # StringComparison for Contains |
| 44 | +dotnet_diagnostic.CA2227.severity = suggestion # Collection properties should be read-only |
| 45 | + |
| 46 | +# In an executable, internal types are encouraged but the existing |
| 47 | +# code base exposes most types publicly. Lower CA1515 to suggestion |
| 48 | +# to surface it without breaking the build. |
| 49 | +dotnet_diagnostic.CA1515.severity = suggestion |
| 50 | + |
| 51 | +# CA1815 / CA1851 noisy across the codebase; keep as suggestion. |
| 52 | +dotnet_diagnostic.CA1851.severity = suggestion |
| 53 | + |
| 54 | +# Security: keep dispose ownership warning visible without breaking. |
| 55 | +# Database lifecycle is managed by ISessionService. |
| 56 | +dotnet_diagnostic.CA2000.severity = suggestion |
| 57 | + |
| 58 | +# CA5392 (DefaultDllImportSearchPaths): keep as suggestion; the |
| 59 | +# P/Invokes target well-known system DLLs (user32, dwmapi). |
| 60 | +dotnet_diagnostic.CA5392.severity = suggestion |
| 61 | + |
| 62 | +# The Core/QrCode logic uses multidimensional arrays for matrix algebra. |
| 63 | +# Rewriting to jagged arrays would degrade readability without any gain. |
| 64 | +dotnet_diagnostic.CA1814.severity = suggestion |
| 65 | + |
| 66 | +# CA1852 (seal internal types): worthwhile but currently noisy in Core. |
| 67 | +dotnet_diagnostic.CA1852.severity = suggestion |
| 68 | + |
| 69 | +# CA2201 (reserved exception types): the codebase intentionally throws |
| 70 | +# NullReferenceException in some places; flag as suggestion until those |
| 71 | +# sites can be reviewed individually. |
| 72 | +dotnet_diagnostic.CA2201.severity = suggestion |
| 73 | + |
| 74 | +# CA1001 (type owns disposable field but is not IDisposable): User holds |
| 75 | +# a DispatcherTimer; the existing lifetime is tied to Database.Dispose. |
| 76 | +# Surfaced as suggestion for a follow-up. |
| 77 | +dotnet_diagnostic.CA1001.severity = suggestion |
| 78 | + |
| 79 | +# Cryptography rules: the existing on-disk format relies on MD5/SHA1/ |
| 80 | +# legacy IV derivation. Changing the algorithms would silently break |
| 81 | +# every existing user database, so they are kept as suggestion and the |
| 82 | +# follow-up will introduce versioned migrations. |
| 83 | +dotnet_diagnostic.CA5350.severity = suggestion |
| 84 | +dotnet_diagnostic.CA5351.severity = suggestion |
| 85 | +dotnet_diagnostic.CA5394.severity = suggestion |
| 86 | +dotnet_diagnostic.CA5401.severity = suggestion |
| 87 | + |
| 88 | +# Visual Studio Editor-only style rules; keep silent when not relevant. |
| 89 | +dotnet_diagnostic.IDE0001.severity = suggestion |
| 90 | +dotnet_diagnostic.IDE0008.severity = suggestion |
| 91 | +dotnet_diagnostic.IDE0028.severity = suggestion |
| 92 | +dotnet_diagnostic.IDE0046.severity = suggestion |
| 93 | +dotnet_diagnostic.IDE0047.severity = suggestion |
| 94 | +dotnet_diagnostic.IDE0048.severity = suggestion |
| 95 | +dotnet_diagnostic.IDE0058.severity = suggestion |
| 96 | +dotnet_diagnostic.IDE0072.severity = suggestion |
| 97 | +dotnet_diagnostic.IDE0290.severity = suggestion |
0 commit comments