.editorconfig 53 KB

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