2
0

.editorconfig 52 KB

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