.editorconfig 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324
  1. // Avoid looking for .editorconfig files in parent directories
  2. root=true
  3. [*]
  4. insert_final_newline = true
  5. indent_style = space
  6. indent_size = 4
  7. tab_width = 4
  8. end_of_line = crlf
  9. [*.cs]
  10. #### Sonar rules ####
  11. # S101: Types should be named in PascalCase
  12. # https://rules.sonarsource.com/csharp/RSPEC-101
  13. #
  14. # TODO: Remove this when code has been updated!
  15. dotnet_diagnostic.S101.severity = none
  16. # S112: General exceptions should never be thrown
  17. # https://rules.sonarsource.com/csharp/RSPEC-112
  18. #
  19. # This is a duplicate of CA2201 and MA0012.
  20. dotnet_diagnostic.S112.severity = none
  21. # S907: Remove use of 'goto'
  22. # https://rules.sonarsource.com/csharp/RSPEC-907
  23. #
  24. # Limited use of 'goto' is accepted when performance is critical.
  25. dotnet_diagnostic.S907.severity = none
  26. # S1066: Collapsible "if" statements should be merged
  27. # https://rules.sonarsource.com/csharp/RSPEC-1066
  28. #
  29. dotnet_diagnostic.S1066.severity = none
  30. # S1075: URIs should not be hardcoded
  31. # https://rules.sonarsource.com/csharp/RSPEC-1075
  32. #
  33. # The rule reports false positives for XML namespaces.
  34. dotnet_diagnostic.S1075.severity = none
  35. # S1104: Fields should not have public accessibility
  36. # https://rules.sonarsource.com/csharp/RSPEC-1104
  37. #
  38. # This is a duplicate of SA1401 and CA1051.
  39. dotnet_diagnostic.S1104.severity = none
  40. # S1125: Boolean literals should not be redundant
  41. # https://rules.sonarsource.com/csharp/RSPEC-1125
  42. #
  43. # This is a duplicate of MA0073.
  44. dotnet_diagnostic.S1125.severity = none
  45. # S1135: Track uses of "TODO" tags
  46. #
  47. # This is a duplicate of MA0026.
  48. dotnet_diagnostic.S1135.severity = none
  49. # S1168: Empty arrays and collections should be returned instead of null
  50. # https://rules.sonarsource.com/csharp/RSPEC-1168
  51. #
  52. # We sometimes return null to avoid allocating an empty List<T>.
  53. dotnet_diagnostic.S1168.severity = none
  54. # S1172: Unused method parameters should be removed
  55. # https://rules.sonarsource.com/csharp/RSPEC-1172
  56. #
  57. # This is a duplicate of IDE0060.
  58. dotnet_diagnostic.S1172.severity = none
  59. # S1481: Unused local variables should be removed
  60. # https://rules.sonarsource.com/csharp/RSPEC-1481
  61. #
  62. # This is a duplicate of IDE0059.
  63. dotnet_diagnostic.S1481.severity = none
  64. # S1854: Unused assignments should be removed
  65. # https://rules.sonarsource.com/csharp/RSPEC-1854
  66. #
  67. # This is a duplicate of IDE0059.
  68. dotnet_diagnostic.S1854.severity = none
  69. # S2259: Null pointers should not be dereferenced
  70. # https://rules.sonarsource.com/csharp/RSPEC-2259
  71. #
  72. # The analysis is not precise enough, leading to false positives.
  73. dotnet_diagnostic.S2259.severity = none
  74. # S2445: Blocks should be synchronized on read-only fields
  75. # https://rules.sonarsource.com/csharp/RSPEC-2445
  76. #
  77. # This is a (partial) duplicate of MA0064.
  78. dotnet_diagnostic.S2445.severity = none
  79. # S2551: Shared resources should not be used for locking
  80. # https://rules.sonarsource.com/csharp/RSPEC-2551
  81. #
  82. # This is a duplicate of CA2002, and partial duplicate of MA0064.
  83. dotnet_diagnostic.S2551.severity = none
  84. # S2583: Conditionally executed code should be reachable
  85. # https://rules.sonarsource.com/csharp/RSPEC-2583
  86. #
  87. # This rule produces false errors in, for example, for loops.
  88. #dotnet_diagnostic.S2583.severity = none
  89. # S2699: Tests should include assertions
  90. # https://rules.sonarsource.com/csharp/RSPEC-2699
  91. #
  92. # Sometimes you want a test in which you invoke a method and just want to verify that it does not throw.
  93. # For example:
  94. # [TestMethod]
  95. # public void InvokeDisposeWithoutNotifyObjectShouldNotThrow()
  96. # {
  97. # _timer.Dispose();
  98. # }
  99. dotnet_diagnostic.S2699.severity = none
  100. # S2933: Fields that are only assigned in the constructor should be "readonly"
  101. # https://rules.sonarsource.com/csharp/RSPEC-2933
  102. #
  103. # This is a duplicate of IDE0044, but IDE0044 is not reported when targeting .NET Framework 4.8.
  104. dotnet_diagnostic.S2933.severity = none
  105. # S2971: "IEnumerable" LINQs should be simplified
  106. # https://rules.sonarsource.com/csharp/RSPEC-2971
  107. #
  108. # This is a duplicate of MA0020.
  109. dotnet_diagnostic.S2971.severity = none
  110. # S3218: Inner class members should not shadow outer class "static" or type members
  111. # https://rules.sonarsource.com/csharp/RSPEC-3218
  112. #
  113. # This is rather harmless.
  114. dotnet_diagnostic.S3218.severity = none
  115. # S3267: Loops should be simplified with "LINQ" expressions
  116. # https://rules.sonarsource.com/csharp/RSPEC-3267
  117. #
  118. # LINQ is the root of all evil :p
  119. dotnet_diagnostic.S3267.severity = none
  120. # S3376: Attribute, EventArgs, and Exception type names should end with the type being extended
  121. # https://rules.sonarsource.com/csharp/RSPEC-3376
  122. #
  123. # This is a partial duplicate of MA0058. If we enable the Sonar in all repositories, we should
  124. # consider enabling S3376 in favor of MA0058.
  125. dotnet_diagnostic.S3376.severity = none
  126. # S3871: Exception types should be "public"
  127. # https://rules.sonarsource.com/csharp/RSPEC-3871
  128. #
  129. # This is a duplicate of CA1064.
  130. dotnet_diagnostic.S3871.severity = none
  131. # S3925: "ISerializable" should be implemented correctly
  132. # https://rules.sonarsource.com/csharp/RSPEC-3925
  133. #
  134. # This is a duplicate of CA2229.
  135. dotnet_diagnostic.S3925.severity = none
  136. # S3928: Parameter names used into ArgumentException constructors should match an existing one
  137. # https://rules.sonarsource.com/csharp/RSPEC-3928
  138. #
  139. # This is a duplicate of MA0015.
  140. dotnet_diagnostic.S3928.severity = none
  141. # S3998: Threads should not lock on objects with weak identity
  142. # https://rules.sonarsource.com/csharp/RSPEC-3998
  143. #
  144. # This is a duplicate of CA2002, and partial duplicate of MA0064.
  145. dotnet_diagnostic.S3998.severity = none
  146. # S4070: Non-flags enums should not be marked with "FlagsAttribute"
  147. # https://rules.sonarsource.com/csharp/RSPEC-4070
  148. #
  149. # This is a duplicate of MA0062.
  150. dotnet_diagnostic.S4070.severity = none
  151. # S4456: Parameter validation in yielding methods should be wrapped
  152. # https://rules.sonarsource.com/csharp/RSPEC-4456
  153. #
  154. # This is a duplicate of MA0050.
  155. dotnet_diagnostic.S4456.severity = none
  156. # S4487: Unread "private" fields should be removed
  157. # https://rules.sonarsource.com/csharp/RSPEC-4487
  158. #
  159. # This is a duplicate of IDE0052.
  160. dotnet_diagnostic.S4487.severity = none
  161. # S4581: "new Guid()" should not be used
  162. # https://rules.sonarsource.com/csharp/RSPEC-4581
  163. #
  164. # This is a partial duplicate of MA0067, and we do not want to report the use of 'default' for a Guid as error.
  165. dotnet_diagnostic.S4581.severity = none
  166. #### StyleCop rules ####
  167. # SA1003: Symbols must be spaced correctly
  168. #
  169. # When enabled, a diagnostic is produced when there's a space after a cast.
  170. # For example:
  171. # var x = (int) z;
  172. dotnet_diagnostic.SA1003.severity = none
  173. # SA1008: Opening parenthesis should not be preceded by a space
  174. #
  175. # When enabled, a diagnostic is produce when a cast precedes braces.
  176. # For example:
  177. # (long) (a * b)
  178. dotnet_diagnostic.SA1008.severity = none
  179. # SA1009: Closing parenthesis should not be followed by a space
  180. #
  181. # When enabled, a diagnostic is produced when there's a space after a cast.
  182. # For example:
  183. # var x = (int) z;
  184. dotnet_diagnostic.SA1009.severity = none
  185. # SA1101: Prefix local calls with this
  186. dotnet_diagnostic.SA1101.severity = none
  187. # SA1116: Split parameters must start on line after declaration
  188. #
  189. # When enabled, a diagnostic is produced when the first parameter is on the same line as the method or constructor.
  190. # For example:
  191. # arrayBuilder.Add(new StatisticsCallInfo(callsByType.Key,
  192. # callsForType.Count);
  193. dotnet_diagnostic.SA1116.severity = none
  194. # SA1200: Using directives must be placed correctly
  195. #
  196. # This is already verified by the .NET compiler platform analyzers (csharp_using_directive_placement option and IDE0065 rule).
  197. dotnet_diagnostic.SA1200.severity = none
  198. # SA1201: Elements must appear in the correct order
  199. dotnet_diagnostic.SA1201.severity = none
  200. # SA1206: Modifiers are not ordered
  201. # https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1206.md
  202. #
  203. # This is a duplicate of IDE0036, except that it cannot be configured and expects the required modifier to be before the
  204. # accessibility modifier.
  205. dotnet_diagnostic.SA1206.severity = none
  206. # SA1309: Field names must not begin with underscore
  207. dotnet_diagnostic.SA1309.severity = none
  208. # SA1405: Debug.Assert should provide message text
  209. #
  210. # To be discussed if we want to enable this.
  211. dotnet_diagnostic.SA1405.severity = none
  212. # SA1413: Use trailing comma in multi-line initializers
  213. dotnet_diagnostic.SA1413.severity = none
  214. # SA1503: Braces should not be omitted
  215. #
  216. # This is a duplicate of IDE0011.
  217. dotnet_diagnostic.SA1503.severity = none
  218. # SA1516: Elements must be separated by blank line
  219. #
  220. # When enabled, a diagnostic is produced for properties with both a get and set accessor.
  221. # For example:
  222. # public bool EnableStatistics
  223. # {
  224. # get
  225. # {
  226. # return _enableStatistics;
  227. # }
  228. # set
  229. # {
  230. # _enableStatistics = value;
  231. # }
  232. # }
  233. dotnet_diagnostic.SA1516.severity = none
  234. # SA1520: Use braces consistently
  235. #
  236. # Since we always require braces (configured via csharp_prefer_braces and reported as IDE0011), it does not make sense to check if braces
  237. # are used consistently.
  238. dotnet_diagnostic.SA1520.severity = none
  239. # SA1633: File must have header
  240. #
  241. # We do not use file headers.
  242. dotnet_diagnostic.SA1633.severity = none
  243. # SA1601: Partial elements should be documented
  244. dotnet_diagnostic.SA1601.severity = none
  245. # SA1648: <inheritdoc> must be used with inheriting class
  246. #
  247. # This rule is disabled by default, hence we need to explicitly enable it.
  248. dotnet_diagnostic.SA1648.severity = error
  249. # SX1101: Do not prefix local members with 'this.'
  250. #
  251. # This rule is disabled by default, hence we need to explicitly enable it.
  252. dotnet_diagnostic.SX1101.severity = error
  253. # SX1309: Field names must begin with underscore
  254. #
  255. # This rule is disabled by default, hence we need to explicitly enable it.
  256. dotnet_diagnostic.SX1309.severity = error
  257. # SX1309S: Static field names must begin with underscore
  258. #
  259. # This rule is disabled by default, hence we need to explicitly enable it.
  260. dotnet_diagnostic.SX1309S.severity = error
  261. #### Meziantou.Analyzer rules ####
  262. # MA0002: Use an overload that has a IEqualityComparer<string> or IComparer<string> parameter
  263. #
  264. # In .NET (Core) there have been quite some optimizations for EqualityComparer<T>.Default (eg. https://github.com/dotnet/coreclr/pull/14125)
  265. # and Comparer<T>.Default (eg. https://github.com/dotnet/runtime/pull/48160).
  266. #
  267. # We'll have to verify impact on performance before we decide to use specific comparers (eg. StringComparer.InvariantCultureIgnoreCase).
  268. dotnet_diagnostic.MA0002.severity = none
  269. # MA0006: Use string.Equals instead of Equals operator
  270. #
  271. # We almost always want ordinal comparison, and using the explicit overload adds a little overhead
  272. # and is more chatty.
  273. dotnet_diagnostic.MA0006.severity = none
  274. # MA0007: Add a comma after the last value
  275. #
  276. # We do not add a comma after the last value in multi-line initializers.
  277. # For example:
  278. # public enum Sex
  279. # {
  280. # Male = 1,
  281. # Female = 2 // No comma here
  282. # }
  283. #
  284. # Note:
  285. # This is a duplicate of SA1413.
  286. dotnet_diagnostic.MA0007.severity = none
  287. # MA0009: Add regex evaluation timeout
  288. #
  289. # We do not see a need guard our regex's against a DOS attack.
  290. dotnet_diagnostic.MA0009.severity = none
  291. # MA0011: IFormatProvider is missing
  292. #
  293. # Also report diagnostic in ToString(...) methods
  294. MA0011.exclude_tostring_methods = false
  295. # MA0012: Do not raise reserved exception type
  296. #
  297. # This is a duplicate of CA2201.
  298. dotnet_diagnostic.MA0012.severity = none
  299. # MA0014: Do not raise System.ApplicationException type
  300. #
  301. # This is a duplicate of CA2201.
  302. dotnet_diagnostic.MA0014.severity = none
  303. # MA0016: Prefer returning collection abstraction instead of implementation
  304. #
  305. # This is a duplicate of CA1002.
  306. dotnet_diagnostic.MA0016.severity = none
  307. # MA0018: Do not declare static members on generic types
  308. #
  309. # This is a duplicate of CA1000.
  310. dotnet_diagnostic.MA0018.severity = none
  311. # MA0021: Use StringComparer.GetHashCode instead of string.GetHashCode
  312. #
  313. # No strong need for this, and may negatively affect performance.
  314. dotnet_diagnostic.MA0021.severity = none
  315. # MA0025: Implement the functionality instead of throwing NotImplementedException
  316. # https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0031.md
  317. dotnet_diagnostic.MA0025.severity = none
  318. # MA0026: Fix TODO comment
  319. # https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0026.md
  320. dotnet_diagnostic.MA0026.severity = suggestion
  321. # MA0031: Optimize Enumerable.Count() usage
  322. # https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0031.md
  323. #
  324. # The proposed code is less readable.
  325. #
  326. # For example:
  327. #
  328. # the following code fragment:
  329. # enumerable.Count() > 10;
  330. #
  331. # would become:
  332. # enumerable.Skip(10).Any();
  333. dotnet_diagnostic.MA0031.severity = none
  334. # MA0036: Make class static
  335. #
  336. # This is a partial duplicate of CA1052.
  337. dotnet_diagnostic.MA0036.severity = none
  338. # MA0038: Make method static
  339. #
  340. # This is a partial duplicate of, and deprecated in favor of, CA1822.
  341. dotnet_diagnostic.MA0038.severity = none
  342. # MA0041: Make property static
  343. #
  344. # This is a partial duplicate of, and deprecated in favor of, CA1822.
  345. dotnet_diagnostic.MA0041.severity = none
  346. # MA0048: File name must match type name
  347. #
  348. # This is a duplicate of SA1649.
  349. dotnet_diagnostic.MA0048.severity = none
  350. # MA0049: Type name should not match containing namespace
  351. #
  352. # This is a duplicate of CA1724
  353. dotnet_diagnostic.MA0049.severity = none
  354. # MA0051: Method is too long
  355. #
  356. # We do not want to limit the number of lines or statements per method.
  357. dotnet_diagnostic.MA0051.severity = none
  358. # MA0053: Make class sealed
  359. #
  360. # Also report diagnostic for public types.
  361. MA0053.public_class_should_be_sealed = true
  362. # MA0053: Make class sealed
  363. #
  364. # Also report diagnostic for types that derive from System.Exception.
  365. MA0053.exceptions_should_be_sealed = true
  366. # MA0053: Make class sealed
  367. #
  368. # Also report diagnostic for types that define (new) virtual members.
  369. MA0053.class_with_virtual_member_shoud_be_sealed = true
  370. # MA0112: Use 'Count > 0' instead of 'Any()'
  371. #
  372. # This rule is disabled by default, hence we need to explicitly enable it.
  373. dotnet_diagnostic.MA0112.severity = error
  374. #### .NET Compiler Platform code quality rules ####
  375. # CA1002: Do not expose generic lists
  376. #
  377. # For performance reasons - to avoid interface dispatch - we expose generic lists
  378. # instead of a base class or interface.
  379. dotnet_diagnostic.CA1002.severity = none
  380. # CA1003: Use generic event handler instances
  381. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1003
  382. #
  383. # Similar to MA0046.
  384. dotnet_diagnostic.CA1003.severity = none
  385. # CA1008: Enums should have zero value
  386. #
  387. # TODO: To be discussed. Having a zero value offers a performance advantage.
  388. dotnet_diagnostic.CA1008.severity = none
  389. # CA1014: Mark assemblies with CLSCompliantAttribute
  390. #
  391. # This rule is disabled by default, hence we need to explicitly enable it.
  392. #
  393. # Even when enabled, this diagnostic does not appear to be reported for assemblies without CLSCompliantAttribute.
  394. # We reported this issue as https://github.com/dotnet/roslyn-analyzers/issues/6563.
  395. dotnet_diagnostic.CA1014.severity = error
  396. # CA1051: Do not declare visible instance fields
  397. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1051
  398. #
  399. # This is a duplicate of S1104 and SA1401.
  400. dotnet_diagnostic.CA1051.severity = none
  401. # CA1052: Static holder types should be Static or NotInheritable
  402. #
  403. # By default, this diagnostic is only reported for public types.
  404. dotnet_code_quality.CA1052.api_surface = all
  405. # CA1065: Do not raise exceptions in unexpected locations
  406. # https://learn.microsoft.com/en-US/dotnet/fundamentals/code-analysis/quality-rules/ca1065
  407. dotnet_diagnostic.CA1065.severity = none
  408. # CA1303: Do not pass literals as localized parameters
  409. #
  410. # We don't care about localization.
  411. dotnet_diagnostic.CA1303.severity = none
  412. # CA1305: Specify IFormatProvider
  413. #
  414. # This is a an equivalent of MA0011, except that it does not report a diagnostic for the use of
  415. # DateTime.TryParse(string s, out DateTime result).
  416. #
  417. # Submitted https://github.com/dotnet/roslyn-analyzers/issues/6096 to fix CA1305.
  418. dotnet_diagnostic.CA1305.severity = none
  419. # CA1309: Use ordinal StringComparison
  420. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1309
  421. dotnet_diagnostic.CA1309.severity = none
  422. # CA1510: Use ArgumentNullException throw helper
  423. #
  424. # This is only available in .NET 6.0 and higher. We'd need to use conditional compilation to only
  425. # use these throw helper when targeting a framework that supports it.
  426. dotnet_diagnostic.CA1510.severity = none
  427. # CA1725: Parameter names should match base declaration
  428. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1725
  429. #
  430. # This is a duplicate of S927, but contains at least one bug:
  431. # https://github.com/dotnet/roslyn-analyzers/issues/6461
  432. #
  433. # Since we do not enable any of the Sonar rules by default, we'll leave CA1725 enabled.
  434. dotnet_diagnostic.CA1725.severity = error
  435. # CA1825: Avoid zero-length array allocations
  436. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1825
  437. #
  438. # This is a duplicate of MA0005.
  439. dotnet_diagnostic.CA1825.severity = none
  440. # CA1819: Properties should not return arrays
  441. #
  442. # Arrays offer better performance than collections.
  443. dotnet_diagnostic.CA1819.severity = none
  444. # CA1828: Mark members as static
  445. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822
  446. #
  447. # Documentation does not mention which API surface(s) this rule runs on, so we explictly configure it.
  448. dotnet_code_quality.CA1828.api_surface = all
  449. # CA1852: Seal internal types
  450. #
  451. # Similar to MA0053, but does not support public types and types that define (new) virtual members.
  452. dotnet_diagnostic.CA1852.severity = none
  453. # CA1859: Change return type for improved performance
  454. #
  455. # By default, this diagnostic is only reported for private members.
  456. dotnet_code_quality.CA1859.api_surface = all
  457. # CA2208: Instantiate argument exceptions correctly
  458. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2208
  459. #
  460. # This is similar to, but less powerful than, MA0015.
  461. dotnet_diagnostic.CA2208.severity = none
  462. # CA5358: Do Not Use Unsafe Cipher Modes / Review cipher mode usage with cryptography experts
  463. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca5358
  464. #
  465. # We use ECB mode as the basis for other modes (e.g. CTR)
  466. dotnet_diagnostic.CA5358.severity = none
  467. # CA5401: Do not use CreateEncryptor with non-default IV
  468. # https://learn.microsoft.com/en-gb/dotnet/fundamentals/code-analysis/quality-rules/ca5401
  469. #
  470. # We need to specify the IV.
  471. dotnet_diagnostic.CA5401.severity = none
  472. #### Roslyn IDE analyser rules ####
  473. # IDE0028: Simplify collection initialization; and
  474. # IDE0305: Simplify collection initialization
  475. #
  476. # Temporarily suppressing collection expression recommendations coming from .NET 8 SDK
  477. dotnet_diagnostic.IDE0028.severity = none
  478. dotnet_diagnostic.IDE0305.severity = none
  479. # IDE0032: Use auto-implemented property
  480. #
  481. # For performance reasons, we do not always want to enforce the use of
  482. # auto-implemented properties.
  483. dotnet_diagnostic.IDE0032.severity = suggestion
  484. # IDE0045: Use conditional expression for assignment
  485. #
  486. # This does not always result in cleaner/clearer code.
  487. dotnet_diagnostic.IDE0045.severity = none
  488. # IDE0046: Use conditional expression for return
  489. #
  490. # Using a conditional expression is not always a clear win for readability.
  491. #
  492. # Configured using 'dotnet_style_prefer_conditional_expression_over_return'
  493. dotnet_diagnostic.IDE0046.severity = suggestion
  494. # IDE0047: Remove unnecessary parentheses
  495. #
  496. # Removing "unnecessary" parentheses is not always a clear win for readability.
  497. dotnet_diagnostic.IDE0047.severity = suggestion
  498. # IDE0055: Fix formatting
  499. #
  500. # When enabled, diagnostics are reported for indented object initializers.
  501. # For example:
  502. # _content = new Person
  503. # {
  504. # Name = "\u13AAlarm"
  505. # };
  506. #
  507. # There are no settings to configure this correctly, unless https://github.com/dotnet/roslyn/issues/63256 (or similar) is ever implemented.
  508. dotnet_diagnostic.IDE0055.severity = none
  509. # IDE0130: Namespace does not match folder structure
  510. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0130
  511. #
  512. # TODO: Remove when https://github.com/sshnet/SSH.NET/issues/1129 is fixed
  513. dotnet_diagnostic.IDE0130.severity = none
  514. # IDE0270: Null check can be simplified
  515. #
  516. # var inputPath = originalDossierPathList.Find(x => x.id == updatedPath.id);
  517. # if (inputPath is null)
  518. # {
  519. # throw new PcsException($"Path id ({updatedPath.id}) unknown in PCS for dossier id {dossierFromTs.dossier.id}", updatedPath.id);
  520. # }
  521. #
  522. # We do not want to modify the code using a null coalescing operator:
  523. #
  524. # var inputPath = originalDossierPathList.Find(x => x.id == updatedPath.id) ?? throw new PcsException($"Path id ({updatedPath.id}) unknown in PCS for dossier id {dossierFromTs.dossier.id}", updatedPath.id);
  525. dotnet_diagnostic.IDE0270.severity = none
  526. # IDE0290: Use primary constructor
  527. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0290
  528. dotnet_diagnostic.IDE0290.severity = none
  529. # IDE0300: Collection initialization can be simplified
  530. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0300
  531. #
  532. # TODO: Discuss whether we want to start using this
  533. dotnet_diagnostic.IDE0300.severity = none
  534. # IDE0301: Simplify collection initialization
  535. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0301
  536. #
  537. # TODO: Discuss whether we want to start using this
  538. dotnet_diagnostic.IDE0301.severity = none
  539. #### .NET Compiler Platform code style rules ####
  540. ### Language rules ###
  541. ## Modifier preferences
  542. dotnet_style_require_accessibility_modifiers = true
  543. dotnet_style_readonly_field = true
  544. csharp_prefer_static_local_function = true
  545. ## Parentheses preferences
  546. dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
  547. dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
  548. dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
  549. dotnet_style_parentheses_in_other_operators = never_if_unnecessary
  550. # Expression-level preferences
  551. dotnet_style_object_initializer = true
  552. csharp_style_inlined_variable_declaration = true
  553. dotnet_style_collection_initializer = true
  554. dotnet_style_prefer_auto_properties = true
  555. dotnet_style_explicit_tuple_names = true
  556. csharp_prefer_simple_default_expression = true
  557. dotnet_style_prefer_inferred_tuple_names = true
  558. dotnet_style_prefer_inferred_anonymous_type_member_names = true
  559. csharp_style_prefer_local_over_anonymous_function = true
  560. csharp_style_deconstructed_variable_declaration = false
  561. dotnet_style_prefer_conditional_expression_over_assignment = true
  562. dotnet_style_prefer_conditional_expression_over_return = true
  563. dotnet_style_prefer_compound_assignment = true
  564. csharp_style_prefer_index_operator = false
  565. csharp_style_prefer_range_operator = false
  566. dotnet_style_prefer_simplified_interpolation = false
  567. dotnet_style_prefer_simplified_boolean_expressions = true
  568. csharp_style_implicit_object_creation_when_type_is_apparent = false
  569. csharp_style_prefer_tuple_swap = false
  570. # Namespace declaration preferences
  571. csharp_style_namespace_declarations = block_scoped
  572. # Null-checking preferences
  573. csharp_style_throw_expression = false
  574. dotnet_style_coalesce_expression = true
  575. dotnet_style_null_propagation = true
  576. dotnet_style_prefer_is_null_check_over_reference_equality_method = true
  577. csharp_style_prefer_null_check_over_type_check = true
  578. csharp_style_conditional_delegate_call = true
  579. # 'var' preferences
  580. csharp_style_var_for_built_in_types = true
  581. csharp_style_var_when_type_is_apparent = true
  582. csharp_style_var_elsewhere = true
  583. # Expression-bodies members
  584. csharp_style_expression_bodied_methods = false
  585. csharp_style_expression_bodied_constructors = false
  586. csharp_style_expression_bodied_operators = false
  587. csharp_style_expression_bodied_properties = false
  588. csharp_style_expression_bodied_indexers = false
  589. csharp_style_expression_bodied_accessors = false
  590. csharp_style_expression_bodied_lambdas = false
  591. csharp_style_expression_bodied_local_functions = false
  592. # Pattern matching preferences
  593. csharp_style_pattern_matching_over_as_with_null_check = true
  594. csharp_style_pattern_matching_over_is_with_cast_check = true
  595. csharp_style_prefer_switch_expression = false
  596. csharp_style_prefer_pattern_matching = true
  597. csharp_style_prefer_not_pattern = true
  598. csharp_style_prefer_extended_property_pattern = true
  599. # Code block preferences
  600. csharp_prefer_braces = true
  601. csharp_prefer_simple_using_statement = false
  602. # Using directive preferences
  603. csharp_using_directive_placement = outside_namespace
  604. # Namespace naming preferences
  605. dotnet_style_namespace_match_folder = true
  606. # Undocumented preferences
  607. csharp_style_prefer_method_group_conversion = false
  608. csharp_style_prefer_top_level_statements = false
  609. ### Formatting rules ###
  610. ## .NET formatting options ##
  611. # Using directive options
  612. dotnet_sort_system_directives_first = true
  613. dotnet_separate_import_directive_groups = true
  614. ## C# formatting options ##
  615. # New-line options
  616. # TNIS-13005: Enabling this setting breaks Resharper indentation for lambdas
  617. #csharp_new_line_before_open_brace = accessors, anonymous_methods, anonymous_types, control_blocks, events, indexers, lambdas, local_functions, methods, object_collection_array_initializers, properties, types
  618. csharp_new_line_before_else = true
  619. csharp_new_line_before_catch = true
  620. csharp_new_line_before_finally = true
  621. # Enabling this setting breaks Resharper formatting for an enum field reference that is
  622. # deeply nested in an object initializer.
  623. #
  624. # For an example, see TDataExchangeGeneralEnricher_CernInfrastructureObstruction.
  625. #csharp_new_line_before_members_in_object_initializers = true
  626. csharp_new_line_before_members_in_anonymous_types = true
  627. csharp_new_line_between_query_expression_clauses = true
  628. # Indentation options
  629. csharp_indent_case_contents = true
  630. csharp_indent_switch_labels = true
  631. csharp_indent_labels = one_less_than_current
  632. csharp_indent_block_contents = true
  633. # TNIS-13005: Enabling this setting breaks Resharper indentation for lambdas
  634. #csharp_indent_braces = false
  635. # TNIS-13005: Enabling this setting breaks Resharper indentation for lambdas
  636. #csharp_indent_case_contents_when_block = true
  637. # Spacing options
  638. csharp_space_after_cast = true
  639. csharp_space_after_keywords_in_control_flow_statements = true
  640. csharp_space_between_parentheses = false
  641. csharp_space_before_colon_in_inheritance_clause = true
  642. csharp_space_after_colon_in_inheritance_clause = true
  643. csharp_space_around_binary_operators = before_and_after
  644. csharp_space_between_method_declaration_parameter_list_parentheses = false
  645. csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
  646. csharp_space_between_method_declaration_name_and_open_parenthesis = false
  647. csharp_space_between_method_call_parameter_list_parentheses = false
  648. csharp_space_between_method_call_empty_parameter_list_parentheses = false
  649. csharp_space_between_method_call_name_and_opening_parenthesis = false
  650. csharp_space_after_comma = true
  651. csharp_space_before_comma = false
  652. csharp_space_after_dot = false
  653. csharp_space_before_dot = false
  654. csharp_space_after_semicolon_in_for_statement = true
  655. csharp_space_before_semicolon_in_for_statement = false
  656. csharp_space_around_declaration_statements = false
  657. csharp_space_before_open_square_brackets = false
  658. csharp_space_between_empty_square_brackets = false
  659. csharp_space_between_square_brackets = false
  660. # Wrap options
  661. csharp_preserve_single_line_statements = false
  662. csharp_preserve_single_line_blocks = true
  663. ### Naming styles ###
  664. # Naming rules
  665. dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
  666. dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
  667. dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
  668. dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
  669. dotnet_naming_rule.types_should_be_pascal_case.symbols = types
  670. dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
  671. dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
  672. dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
  673. dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
  674. dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.symbols = private_fields
  675. dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.style = camel_case_begins_with_underscore
  676. dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.severity = error
  677. dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.symbols = private_static_fields
  678. dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.style = camel_case_begins_with_underscore
  679. dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.severity = error
  680. dotnet_naming_rule.private_static_readonly_fields_pascal_case.symbols = private_static_readonly_fields
  681. dotnet_naming_rule.private_static_readonly_fields_pascal_case.style = pascal_case
  682. dotnet_naming_rule.private_static_readonly_fields_pascal_case.severity = error
  683. dotnet_naming_rule.private_const_fields_pascal_case.symbols = private_const_fields
  684. dotnet_naming_rule.private_const_fields_pascal_case.style = pascal_case
  685. dotnet_naming_rule.private_const_fields_pascal_case.severity = error
  686. # Symbol specifications
  687. dotnet_naming_symbols.interface.applicable_kinds = interface
  688. dotnet_naming_symbols.interface.applicable_accessibilities = *
  689. dotnet_naming_symbols.interface.required_modifiers =
  690. dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
  691. dotnet_naming_symbols.types.applicable_accessibilities = *
  692. dotnet_naming_symbols.types.required_modifiers =
  693. dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
  694. dotnet_naming_symbols.non_field_members.applicable_accessibilities = *
  695. dotnet_naming_symbols.non_field_members.required_modifiers =
  696. dotnet_naming_symbols.private_fields.applicable_kinds = field
  697. dotnet_naming_symbols.private_fields.applicable_accessibilities = private
  698. dotnet_naming_symbols.private_fields.required_modifiers =
  699. dotnet_naming_symbols.private_static_fields.applicable_kinds = field
  700. dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private
  701. dotnet_naming_symbols.private_static_fields.required_modifiers = static
  702. dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field
  703. dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private
  704. dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = static, readonly
  705. dotnet_naming_symbols.private_const_fields.applicable_kinds = field
  706. dotnet_naming_symbols.private_const_fields.applicable_accessibilities = private
  707. dotnet_naming_symbols.private_const_fields.required_modifiers = const
  708. # Naming styles
  709. dotnet_naming_style.begins_with_i.required_prefix = I
  710. dotnet_naming_style.begins_with_i.required_suffix =
  711. dotnet_naming_style.begins_with_i.word_separator =
  712. dotnet_naming_style.begins_with_i.capitalization = pascal_case
  713. dotnet_naming_style.pascal_case.required_prefix =
  714. dotnet_naming_style.pascal_case.required_suffix =
  715. dotnet_naming_style.pascal_case.word_separator =
  716. dotnet_naming_style.pascal_case.capitalization = pascal_case
  717. dotnet_naming_style.camel_case_begins_with_underscore.required_prefix = _
  718. dotnet_naming_style.camel_case_begins_with_underscore.required_suffix =
  719. dotnet_naming_style.camel_case_begins_with_underscore.word_separator =
  720. dotnet_naming_style.camel_case_begins_with_underscore.capitalization = camel_case
  721. #### .NET Compiler Platform general options ####
  722. # Change the default rule severity for all analyzer rules that are enabled by default
  723. dotnet_analyzer_diagnostic.severity = error
  724. #### .NET Compiler Platform code refactoring rules ####
  725. dotnet_style_operator_placement_when_wrapping = end_of_line
  726. #### ReSharper code style for C# ####
  727. ## Blank Lines
  728. resharper_csharp_blank_lines_around_region = 1
  729. resharper_csharp_blank_lines_inside_region = 1
  730. resharper_csharp_blank_lines_before_single_line_comment = 1
  731. resharper_csharp_keep_blank_lines_in_declarations = 1
  732. resharper_csharp_remove_blank_lines_near_braces_in_declarations = true
  733. resharper_csharp_blank_lines_after_start_comment = 1
  734. resharper_csharp_blank_lines_between_using_groups = 1
  735. resharper_csharp_blank_lines_after_using_list = 1
  736. resharper_csharp_blank_lines_around_namespace = 1
  737. resharper_csharp_blank_lines_inside_namespace = 0
  738. resharper_csharp_blank_lines_after_file_scoped_namespace_directive = 1
  739. resharper_csharp_blank_lines_around_type = 1
  740. resharper_csharp_blank_lines_around_single_line_type = 1
  741. resharper_csharp_blank_lines_inside_type = 0
  742. resharper_csharp_blank_lines_around_field = 0
  743. resharper_csharp_blank_lines_around_single_line_field = 0
  744. resharper_csharp_blank_lines_around_property = 1
  745. resharper_csharp_blank_lines_around_single_line_property = 1
  746. resharper_csharp_blank_lines_around_auto_property = 1
  747. resharper_csharp_blank_lines_around_single_line_auto_property = 1
  748. resharper_csharp_blank_lines_around_accessor = 0
  749. resharper_csharp_blank_lines_around_single_line_accessor = 0
  750. resharper_csharp_blank_lines_around_invocable = 1
  751. resharper_csharp_blank_lines_around_single_line_invocable = 1
  752. resharper_csharp_keep_blank_lines_in_code = 1
  753. resharper_csharp_remove_blank_lines_near_braces_in_code = true
  754. resharper_csharp_blank_lines_around_local_method = 1
  755. resharper_csharp_blank_lines_around_single_line_local_method = 1
  756. resharper_csharp_blank_lines_before_control_transfer_statements = 0
  757. resharper_csharp_blank_lines_after_control_transfer_statements = 0
  758. resharper_csharp_blank_lines_before_block_statements = 0
  759. resharper_csharp_blank_lines_after_block_statements = 1
  760. resharper_csharp_blank_lines_before_multiline_statements = 0
  761. resharper_csharp_blank_lines_after_multiline_statements = 0
  762. resharper_csharp_blank_lines_around_block_case_section = 0
  763. resharper_csharp_blank_lines_around_multiline_case_section = 0
  764. resharper_csharp_blank_lines_before_case = 0
  765. resharper_csharp_blank_lines_after_case = 0
  766. ## Braces Layout
  767. resharper_csharp_type_declaration_braces = next_line
  768. resharper_csharp_indent_inside_namespace = true
  769. resharper_csharp_invocable_declaration_braces = next_line
  770. resharper_csharp_anonymous_method_declaration_braces = next_line_shifted_2
  771. resharper_csharp_accessor_owner_declaration_braces = next_line
  772. resharper_csharp_accessor_declaration_braces = next_line
  773. resharper_csharp_case_block_braces = next_line_shifted_2
  774. resharper_csharp_initializer_braces = next_line_shifted_2
  775. resharper_csharp_use_continuous_indent_inside_initializer_braces = true
  776. resharper_csharp_other_braces = next_line
  777. resharper_csharp_allow_comment_after_lbrace = false
  778. resharper_csharp_empty_block_style = multiline
  779. ## Syntax Style
  780. # 'var' usage in declarations
  781. resharper_csharp_for_built_in_types = use_var
  782. resharper_csharp_for_simple_types = use_var
  783. resharper_csharp_for_other_types = use_var
  784. # Instance members qualification
  785. resharper_csharp_instance_members_qualify_members = none
  786. resharper_csharp_instance_members_qualify_declared_in = base_class
  787. # Static members qualification
  788. resharper_csharp_static_members_qualify_with = declared_type
  789. resharper_csharp_static_members_qualify_members = none
  790. # Built-in types
  791. resharper_csharp_builtin_type_reference_style = use_keyword
  792. resharper_csharp_builtin_type_reference_for_member_access_style = use_keyword
  793. # Reference qualification and 'using' directives
  794. resharper_csharp_prefer_qualified_reference = false
  795. resharper_csharp_add_imports_to_deepest_scope = false
  796. resharper_csharp_qualified_using_at_nested_scope = false
  797. resharper_csharp_allow_alias = true
  798. resharper_csharp_can_use_global_alias = true
  799. # Modifiers
  800. resharper_csharp_default_private_modifier = explicit
  801. resharper_csharp_default_internal_modifier = explicit
  802. resharper_csharp_modifiers_order = public private protected internal file static extern new virtual abstract sealed override readonly unsafe required volatile async
  803. # Braces
  804. resharper_csharp_braces_for_ifelse = required
  805. resharper_csharp_braces_for_for = required
  806. resharper_csharp_braces_for_foreach = required
  807. resharper_csharp_braces_for_while = required
  808. resharper_csharp_braces_for_dowhile = required
  809. resharper_csharp_braces_for_using = required
  810. resharper_csharp_braces_for_lock = required
  811. resharper_csharp_braces_for_fixed = required
  812. resharper_csharp_braces_redundant = false
  813. # Code body
  814. resharper_csharp_method_or_operator_body = block_body
  815. resharper_csharp_local_function_body = block_body
  816. resharper_csharp_constructor_or_destructor_body = block_body
  817. resharper_csharp_accessor_owner_body = accessors_with_block_body
  818. resharper_csharp_namespace_body = block_scoped
  819. resharper_csharp_use_heuristics_for_body_style = false
  820. # Trailing comma
  821. resharper_csharp_trailing_comma_in_multiline_lists = false
  822. resharper_csharp_trailing_comma_in_singleline_lists = false
  823. # Object creation
  824. resharper_csharp_object_creation_when_type_evident = explicitly_typed
  825. resharper_csharp_object_creation_when_type_not_evident = explicitly_typed
  826. # Default value
  827. resharper_csharp_default_value_when_type_evident = default_literal
  828. resharper_csharp_default_value_when_type_not_evident = default_literal
  829. ## Tabs, Indents, Alignment
  830. # Nested statements
  831. resharper_csharp_indent_nested_usings_stmt = false
  832. resharper_csharp_indent_nested_fixed_stmt = false
  833. resharper_csharp_indent_nested_lock_stmt = false
  834. resharper_csharp_indent_nested_for_stmt = true
  835. resharper_csharp_indent_nested_foreach_stmt = true
  836. resharper_csharp_indent_nested_while_stmt = true
  837. # Parenthesis
  838. resharper_csharp_use_continuous_indent_inside_parens = true
  839. resharper_csharp_indent_method_decl_pars = outside_and_inside
  840. resharper_csharp_indent_invocation_pars = outside_and_inside
  841. resharper_csharp_indent_statement_pars = outside_and_inside
  842. resharper_csharp_indent_typeparam_angles = outside_and_inside
  843. resharper_csharp_indent_typearg_angles = outside_and_inside
  844. resharper_csharp_indent_pars = outside_and_inside
  845. # Preprocessor directives
  846. resharper_csharp_indent_preprocessor_if = no_indent
  847. resharper_csharp_indent_preprocessor_region = usual_indent
  848. resharper_csharp_indent_preprocessor_other = no_indent
  849. # Other indents
  850. resharper_indent_switch_labels = true
  851. resharper_csharp_outdent_statement_labels = true
  852. resharper_csharp_indent_type_constraints = true
  853. resharper_csharp_stick_comment = false
  854. resharper_csharp_place_comments_at_first_column = false
  855. resharper_csharp_use_indent_from_previous_element = true
  856. resharper_csharp_indent_braces_inside_statement_conditions = true
  857. # Align multiline constructs
  858. resharper_csharp_alignment_tab_fill_style = use_spaces
  859. resharper_csharp_allow_far_alignment = true
  860. resharper_csharp_align_multiline_parameter = true
  861. resharper_csharp_align_multiline_extends_list = true
  862. resharper_csharp_align_linq_query = true
  863. resharper_csharp_align_multiline_binary_expressions_chain = true
  864. resharper_csharp_outdent_binary_ops = false
  865. resharper_csharp_align_multiline_calls_chain = true
  866. resharper_csharp_outdent_dots = false
  867. resharper_csharp_align_multiline_array_and_object_initializer = false
  868. resharper_csharp_align_multiline_switch_expression = false
  869. resharper_csharp_align_multiline_property_pattern = false
  870. resharper_csharp_align_multiline_list_pattern = false
  871. resharper_csharp_align_multiline_binary_patterns = false
  872. resharper_csharp_outdent_binary_pattern_ops = false
  873. resharper_csharp_indent_anonymous_method_block = true
  874. resharper_csharp_align_first_arg_by_paren = false
  875. resharper_csharp_align_multiline_argument = true
  876. resharper_csharp_align_tuple_components = true
  877. resharper_csharp_align_multiline_expression = true
  878. resharper_csharp_align_multiline_statement_conditions = true
  879. resharper_csharp_align_multiline_for_stmt = true
  880. resharper_csharp_align_multiple_declaration = true
  881. resharper_csharp_align_multline_type_parameter_list = true
  882. resharper_csharp_align_multline_type_parameter_constrains = true
  883. resharper_csharp_outdent_commas = false
  884. ## Line Breaks
  885. # General
  886. resharper_csharp_keep_user_linebreaks = true
  887. resharper_csharp_max_line_length = 140
  888. resharper_csharp_wrap_before_comma = false
  889. resharper_csharp_wrap_before_eq = false
  890. resharper_csharp_special_else_if_treatment = true
  891. resharper_csharp_insert_final_newline = true
  892. # Arrangement of attributes
  893. resharper_csharp_keep_existing_attribute_arrangement = false
  894. resharper_csharp_place_type_attribute_on_same_line = false
  895. resharper_csharp_place_method_attribute_on_same_line = false
  896. resharper_csharp_place_accessorholder_attribute_on_same_line = false
  897. resharper_csharp_place_accessor_attribute_on_same_line = false
  898. resharper_csharp_place_field_attribute_on_same_line = false
  899. resharper_csharp_place_record_field_attribute_on_same_line = true
  900. # Arrangement of method signatures
  901. resharper_csharp_place_constructor_initializer_on_same_line = false
  902. resharper_csharp_place_expr_method_on_single_line = true
  903. resharper_csharp_place_expr_property_on_single_line = true
  904. resharper_csharp_place_expr_accessor_on_single_line = true
  905. # Arrangement of type parameters, constraints, and base types
  906. resharper_csharp_place_type_constraints_on_same_line = false
  907. resharper_csharp_wrap_before_first_type_parameter_constraint = true
  908. # Arrangement of declaration blocks
  909. resharper_csharp_place_abstract_accessorholder_on_single_line = true
  910. # Arrangement of statements
  911. resharper_new_line_before_else = true
  912. resharper_new_line_before_while = true
  913. resharper_new_line_before_catch = true
  914. resharper_new_line_before_finally = true
  915. resharper_wrap_for_stmt_header_style = chop_if_long
  916. resharper_wrap_multiple_declaration_style = chop_always
  917. ## Spaces
  918. # Preserve existing formatting
  919. resharper_csharp_extra_spaces = remove_all
  920. # Before parentheses in statements
  921. resharper_csharp_space_before_if_parentheses = true
  922. resharper_csharp_space_before_while_parentheses = true
  923. resharper_csharp_space_before_catch_parentheses = true
  924. resharper_csharp_space_before_switch_parentheses = true
  925. resharper_csharp_space_before_for_parentheses = true
  926. resharper_csharp_space_before_foreach_parentheses = true
  927. resharper_csharp_space_before_using_parentheses = true
  928. resharper_csharp_space_before_lock_parentheses = true
  929. resharper_csharp_space_before_fixed_parentheses = true
  930. # Before other parentheses
  931. resharper_csharp_space_before_method_call_parentheses = false
  932. resharper_csharp_space_before_empty_method_call_parentheses = false
  933. resharper_csharp_space_before_method_parentheses = false
  934. resharper_csharp_space_before_empty_method_parentheses = false
  935. resharper_csharp_space_before_typeof_parentheses = false
  936. resharper_csharp_space_before_default_parentheses = false
  937. resharper_csharp_space_before_checked_parentheses = false
  938. resharper_csharp_space_before_sizeof_parentheses = false
  939. resharper_csharp_space_before_nameof_parentheses = false
  940. resharper_csharp_space_before_new_parentheses = false
  941. resharper_csharp_space_between_keyword_and_expression = true
  942. resharper_csharp_space_between_keyword_and_type = false
  943. # Within parentheses in statements
  944. resharper_csharp_space_within_if_parentheses = false
  945. resharper_csharp_space_within_while_parentheses = false
  946. resharper_csharp_space_within_catch_parentheses = false
  947. resharper_csharp_space_within_switch_parentheses = false
  948. resharper_csharp_space_within_for_parentheses = false
  949. resharper_csharp_space_within_foreach_parentheses = false
  950. resharper_csharp_space_within_using_parentheses = false
  951. resharper_csharp_space_within_lock_parentheses = false
  952. resharper_csharp_space_within_fixed_parentheses = false
  953. # Within other parentheses
  954. resharper_csharp_space_within_parentheses = false
  955. resharper_csharp_space_between_typecast_parentheses = false
  956. resharper_csharp_space_between_method_declaration_parameter_list_parentheses = false
  957. resharper_csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
  958. resharper_csharp_space_between_method_call_parameter_list_parentheses = false
  959. resharper_csharp_space_between_method_call_empty_parameter_list_parentheses = false
  960. resharper_csharp_space_within_typeof_parentheses = false
  961. resharper_csharp_space_within_default_parentheses = false
  962. resharper_csharp_space_within_checked_parentheses = false
  963. resharper_csharp_space_within_sizeof_parentheses = false
  964. resharper_csharp_space_within_nameof_parentheses = false
  965. resharper_csharp_space_within_new_parentheses = false
  966. # Around array brackets
  967. resharper_csharp_space_before_array_access_brackets = false
  968. resharper_csharp_space_before_open_square_brackets = false
  969. resharper_csharp_space_before_array_rank_brackets = false
  970. resharper_csharp_space_within_array_access_brackets = false
  971. resharper_csharp_space_between_square_brackets = false
  972. resharper_csharp_space_within_array_rank_brackets = false
  973. resharper_csharp_space_within_array_rank_empty_brackets = false
  974. resharper_csharp_space_between_empty_square_bracket = false
  975. # Around angle brackets
  976. resharper_csharp_space_before_type_parameter_angle = false
  977. resharper_csharp_space_before_type_argument_angle = false
  978. resharper_csharp_space_within_type_parameter_angles = false
  979. resharper_csharp_space_within_type_argument_angles = false
  980. ### ReSharper code style for XMLDOC ###
  981. ## Tabs and indents
  982. resharper_xmldoc_indent_style = space
  983. # ReSharper currently ignores this setting. See https://youtrack.jetbrains.com/issue/RSRP-465678/XMLDOC-indent-settings-ignored.
  984. resharper_xmldoc_indent_size = 2
  985. resharper_xmldoc_tab_width = 2
  986. resharper_xmldoc_alignment_tab_fill_style = use_spaces
  987. resharper_xmldoc_allow_far_alignment = true
  988. ## Line wrapping
  989. resharper_xmldoc_max_line_length = 140
  990. resharper_xmldoc_wrap_tags_and_pi = false
  991. ## Processing instructions
  992. resharper_xmldoc_spaces_around_eq_in_pi_attribute = false
  993. resharper_xmldoc_space_after_last_pi_attribute = false
  994. resharper_xmldoc_pi_attribute_style = on_single_line
  995. resharper_xmldoc_pi_attributes_indent = align_by_first_attribute
  996. resharper_xmldoc_blank_line_after_pi = false
  997. ## Inside of tag header
  998. resharper_xmldoc_spaces_around_eq_in_attribute = false
  999. resharper_xmldoc_space_after_last_attribute = false
  1000. resharper_xmldoc_space_before_self_closing = false
  1001. resharper_xmldoc_attribute_style = do_not_touch
  1002. resharper_xmldoc_attribute_indent = align_by_first_attribute
  1003. ## Tag content
  1004. resharper_xmldoc_keep_user_linebreaks = true
  1005. resharper_xmldoc_linebreaks_inside_tags_for_multiline_elements = true
  1006. resharper_xmldoc_linebreaks_inside_tags_for_elements_with_child_elements = false
  1007. resharper_xmldoc_spaces_inside_tags = false
  1008. resharper_xmldoc_wrap_text = false
  1009. resharper_xmldoc_wrap_around_elements = false
  1010. # ReSharper currently ignores the 'resharper_xmldoc_indent_size' setting. Once https://youtrack.jetbrains.com/issue/RSRP-465678/XMLDOC-indent-settings-ignored
  1011. # is fixed, we should change the value of this setting to 'one_indent'.
  1012. resharper_xmldoc_indent_child_elements = zero_indent
  1013. resharper_xmldoc_indent_text = zero_indent
  1014. ## Around tags
  1015. resharper_xmldoc_max_blank_lines_between_tags = 1
  1016. resharper_xmldoc_linebreak_before_multiline_elements = true
  1017. resharper_xmldoc_linebreak_before_singleline_elements = false
  1018. [*.{xml,xsd,csproj,targets,proj,props,runsettings,config}]
  1019. #### ReSharper code style for XML ####
  1020. ## Tabs and indents
  1021. resharper_xml_indent_style = space
  1022. resharper_xml_indent_size = 4
  1023. resharper_xml_tab_width = 4
  1024. resharper_xml_alignment_tab_fill_style = use_spaces
  1025. resharper_xml_allow_far_alignment = true
  1026. ## Line wrapping
  1027. resharper_xml_wrap_tags_and_pi = false
  1028. ## Processing instructions
  1029. resharper_xml_spaces_around_eq_in_pi_attribute = false
  1030. resharper_xml_space_after_last_pi_attribute = false
  1031. resharper_xml_pi_attribute_style = on_single_line
  1032. resharper_xml_pi_attributes_indent = align_by_first_attribute
  1033. resharper_xml_blank_line_after_pi = false
  1034. ## Inside of tag header
  1035. resharper_xml_spaces_around_eq_in_attribute = false
  1036. resharper_xml_space_after_last_attribute = false
  1037. resharper_xml_space_before_self_closing = true
  1038. resharper_xml_attribute_style = do_not_touch
  1039. resharper_xml_attribute_indent = align_by_first_attribute
  1040. ## Tag content
  1041. resharper_xml_keep_user_linebreaks = true
  1042. resharper_xml_linebreaks_inside_tags_for_multiline_elements = false
  1043. resharper_xml_linebreaks_inside_tags_for_elements_with_child_elements = false
  1044. resharper_xml_linebreaks_inside_tags_for_elements_longer_than = false
  1045. resharper_xml_spaces_inside_tags = false
  1046. resharper_xml_wrap_text = false
  1047. resharper_xml_wrap_around_elements = false
  1048. resharper_xml_indent_child_elements = one_indent
  1049. resharper_xml_indent_text = zero_indent
  1050. resharper_xml_max_blank_lines_between_tags = 1
  1051. resharper_xml_linebreak_before_multiline_elements = false
  1052. resharper_xml_linebreak_before_singleline_elements = false
  1053. ## Other
  1054. resharper_xml_insert_final_newline = true