2
0

.editorconfig 53 KB

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