.editorconfig 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497
  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 = warning
  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 = warning
  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 = warning
  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 = warning
  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 = warning
  501. # MA0165: Make interpolated string
  502. dotnet_diagnostic.MA0165.severity = none
  503. #### MSTest rules ####
  504. # MSTEST0015: Test method should not be ignored
  505. dotnet_diagnostic.MSTEST0015.severity = suggestion
  506. # MSTEST0032: Assertion condition is always true
  507. dotnet_diagnostic.MSTEST0032.severity = suggestion
  508. #### .NET Compiler Platform code quality rules ####
  509. # CA1002: Do not expose generic lists
  510. #
  511. # For performance reasons - to avoid interface dispatch - we expose generic lists
  512. # instead of a base class or interface.
  513. dotnet_diagnostic.CA1002.severity = none
  514. # CA1003: Use generic event handler instances
  515. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1003
  516. #
  517. # Similar to MA0046.
  518. dotnet_diagnostic.CA1003.severity = none
  519. # CA1008: Enums should have zero value
  520. #
  521. # TODO: To be discussed. Having a zero value offers a performance advantage.
  522. dotnet_diagnostic.CA1008.severity = none
  523. # CA1014: Mark assemblies with CLSCompliantAttribute
  524. #
  525. # This rule is disabled by default, hence we need to explicitly enable it.
  526. #
  527. # Even when enabled, this diagnostic does not appear to be reported for assemblies without CLSCompliantAttribute.
  528. # We reported this issue as https://github.com/dotnet/roslyn-analyzers/issues/6563.
  529. dotnet_diagnostic.CA1014.severity = warning
  530. # CA1051: Do not declare visible instance fields
  531. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1051
  532. #
  533. # This is a duplicate of S1104 and SA1401.
  534. dotnet_diagnostic.CA1051.severity = none
  535. # CA1052: Static holder types should be Static or NotInheritable
  536. #
  537. # By default, this diagnostic is only reported for public types.
  538. dotnet_code_quality.CA1052.api_surface = all
  539. # CA1065: Do not raise exceptions in unexpected locations
  540. # https://learn.microsoft.com/en-US/dotnet/fundamentals/code-analysis/quality-rules/ca1065
  541. dotnet_diagnostic.CA1065.severity = none
  542. # CA1303: Do not pass literals as localized parameters
  543. #
  544. # We don't care about localization.
  545. dotnet_diagnostic.CA1303.severity = none
  546. # CA1305: Specify IFormatProvider
  547. #
  548. # This is a an equivalent of MA0011, except that it does not report a diagnostic for the use of
  549. # DateTime.TryParse(string s, out DateTime result).
  550. #
  551. # Submitted https://github.com/dotnet/roslyn-analyzers/issues/6096 to fix CA1305.
  552. dotnet_diagnostic.CA1305.severity = none
  553. # CA1309: Use ordinal StringComparison
  554. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1309
  555. dotnet_diagnostic.CA1309.severity = none
  556. # CA1510: Use ArgumentNullException throw helper
  557. #
  558. # This is only available in .NET 6.0 and higher. We'd need to use conditional compilation to only
  559. # use these throw helper when targeting a framework that supports it.
  560. dotnet_diagnostic.CA1510.severity = none
  561. # CA1725: Parameter names should match base declaration
  562. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1725
  563. #
  564. # This is a duplicate of S927, but contains at least one bug:
  565. # https://github.com/dotnet/roslyn-analyzers/issues/6461
  566. dotnet_diagnostic.CA1725.severity = none
  567. # CA1825: Avoid zero-length array allocations
  568. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1825
  569. #
  570. # This is a duplicate of MA0005.
  571. dotnet_diagnostic.CA1825.severity = none
  572. # CA1819: Properties should not return arrays
  573. #
  574. # Arrays offer better performance than collections.
  575. dotnet_diagnostic.CA1819.severity = none
  576. # CA1828: Mark members as static
  577. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1822
  578. #
  579. # Documentation does not mention which API surface(s) this rule runs on, so we explictly configure it.
  580. dotnet_code_quality.CA1828.api_surface = all
  581. # CA1852: Seal internal types
  582. #
  583. # Similar to MA0053, but does not support public types and types that define (new) virtual members.
  584. dotnet_diagnostic.CA1852.severity = none
  585. # CA1848: don't enforce LoggerMessage pattern
  586. dotnet_diagnostic.CA1848.severity = suggestion
  587. # CA1859: Change return type for improved performance
  588. #
  589. # By default, this diagnostic is only reported for private members.
  590. dotnet_code_quality.CA1859.api_surface = private,internal
  591. # CA2208: Instantiate argument exceptions correctly
  592. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca2208
  593. #
  594. # This is similar to, but less powerful than, MA0015.
  595. dotnet_diagnostic.CA2208.severity = none
  596. # CA5358: Do Not Use Unsafe Cipher Modes / Review cipher mode usage with cryptography experts
  597. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca5358
  598. #
  599. # We use ECB mode as the basis for other modes (e.g. CTR)
  600. dotnet_diagnostic.CA5358.severity = none
  601. # CA5389: Do not add archive item's path to the target file system path
  602. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca5389
  603. dotnet_diagnostic.CA5389.severity = none
  604. # CA5390: Do not hard-code encryption key
  605. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca5390
  606. dotnet_diagnostic.CA5390.severity = none
  607. # CA5401: Do not use CreateEncryptor with non-default IV
  608. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca5401
  609. dotnet_diagnostic.CA5401.severity = none
  610. # CA5402: Use CreateEncryptor with the default IV
  611. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca5402
  612. dotnet_diagnostic.CA5402.severity = none
  613. # CA5403: Do not hard-code certificate
  614. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca5403
  615. dotnet_diagnostic.CA5403.severity = none
  616. #### Roslyn IDE analyser rules ####
  617. # IDE0028: Simplify collection initialization; and
  618. # IDE0305: Simplify collection initialization
  619. #
  620. # Temporarily suppressing collection expression recommendations coming from .NET 8 SDK
  621. dotnet_diagnostic.IDE0028.severity = none
  622. dotnet_diagnostic.IDE0305.severity = none
  623. # IDE0032: Use auto-implemented property
  624. #
  625. # For performance reasons, we do not always want to enforce the use of
  626. # auto-implemented properties.
  627. dotnet_diagnostic.IDE0032.severity = suggestion
  628. # IDE0045: Use conditional expression for assignment
  629. #
  630. # This does not always result in cleaner/clearer code.
  631. dotnet_diagnostic.IDE0045.severity = none
  632. # IDE0046: Use conditional expression for return
  633. #
  634. # Using a conditional expression is not always a clear win for readability.
  635. #
  636. # Configured using 'dotnet_style_prefer_conditional_expression_over_return'
  637. dotnet_diagnostic.IDE0046.severity = suggestion
  638. # IDE0047: Remove unnecessary parentheses
  639. #
  640. # Removing "unnecessary" parentheses is not always a clear win for readability.
  641. dotnet_diagnostic.IDE0047.severity = suggestion
  642. # IDE0130: Namespace does not match folder structure
  643. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0130
  644. #
  645. # TODO: Remove when https://github.com/sshnet/SSH.NET/issues/1129 is fixed
  646. dotnet_diagnostic.IDE0130.severity = none
  647. # IDE0270: Null check can be simplified
  648. #
  649. # var inputPath = originalDossierPathList.Find(x => x.id == updatedPath.id);
  650. # if (inputPath is null)
  651. # {
  652. # throw new PcsException($"Path id ({updatedPath.id}) unknown in PCS for dossier id {dossierFromTs.dossier.id}", updatedPath.id);
  653. # }
  654. #
  655. # We do not want to modify the code using a null coalescing operator:
  656. #
  657. # 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);
  658. dotnet_diagnostic.IDE0270.severity = none
  659. # IDE0290: Use primary constructor
  660. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0290
  661. dotnet_diagnostic.IDE0290.severity = none
  662. # IDE0300: Collection initialization can be simplified
  663. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0300
  664. #
  665. # TODO: Discuss whether we want to start using this
  666. dotnet_diagnostic.IDE0300.severity = none
  667. # IDE0301: Simplify collection initialization
  668. # https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0301
  669. #
  670. # TODO: Discuss whether we want to start using this
  671. dotnet_diagnostic.IDE0301.severity = none
  672. #### .NET Compiler Platform code style rules ####
  673. ### Language rules ###
  674. ## Modifier preferences
  675. dotnet_style_require_accessibility_modifiers = true
  676. dotnet_style_readonly_field = true
  677. csharp_prefer_static_local_function = true
  678. ## Parentheses preferences
  679. dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
  680. dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
  681. dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
  682. dotnet_style_parentheses_in_other_operators = never_if_unnecessary
  683. # Expression-level preferences
  684. dotnet_style_object_initializer = true
  685. csharp_style_inlined_variable_declaration = true
  686. dotnet_style_collection_initializer = true
  687. dotnet_style_prefer_auto_properties = true
  688. dotnet_style_explicit_tuple_names = true
  689. csharp_prefer_simple_default_expression = true
  690. dotnet_style_prefer_inferred_tuple_names = true
  691. dotnet_style_prefer_inferred_anonymous_type_member_names = true
  692. csharp_style_prefer_local_over_anonymous_function = true
  693. csharp_style_deconstructed_variable_declaration = false
  694. dotnet_style_prefer_conditional_expression_over_assignment = true
  695. dotnet_style_prefer_conditional_expression_over_return = true
  696. dotnet_style_prefer_compound_assignment = true
  697. csharp_style_prefer_index_operator = false
  698. csharp_style_prefer_range_operator = false
  699. dotnet_style_prefer_simplified_interpolation = false
  700. dotnet_style_prefer_simplified_boolean_expressions = true
  701. csharp_style_implicit_object_creation_when_type_is_apparent = false
  702. csharp_style_prefer_tuple_swap = false
  703. # Namespace declaration preferences
  704. csharp_style_namespace_declarations = block_scoped
  705. # Null-checking preferences
  706. csharp_style_throw_expression = false
  707. dotnet_style_coalesce_expression = true
  708. dotnet_style_null_propagation = true
  709. dotnet_style_prefer_is_null_check_over_reference_equality_method = true
  710. csharp_style_prefer_null_check_over_type_check = true
  711. csharp_style_conditional_delegate_call = true
  712. # 'var' preferences
  713. csharp_style_var_for_built_in_types = true
  714. csharp_style_var_when_type_is_apparent = true
  715. csharp_style_var_elsewhere = true
  716. # Expression-bodies members
  717. csharp_style_expression_bodied_methods = false
  718. csharp_style_expression_bodied_constructors = false
  719. csharp_style_expression_bodied_operators = false
  720. csharp_style_expression_bodied_properties = false
  721. csharp_style_expression_bodied_indexers = false
  722. csharp_style_expression_bodied_accessors = false
  723. csharp_style_expression_bodied_lambdas = false
  724. csharp_style_expression_bodied_local_functions = false
  725. # Pattern matching preferences
  726. csharp_style_pattern_matching_over_as_with_null_check = true
  727. csharp_style_pattern_matching_over_is_with_cast_check = true
  728. csharp_style_prefer_switch_expression = false
  729. csharp_style_prefer_pattern_matching = true
  730. csharp_style_prefer_not_pattern = true
  731. csharp_style_prefer_extended_property_pattern = true
  732. # Code block preferences
  733. csharp_prefer_braces = true
  734. csharp_prefer_simple_using_statement = false
  735. # Using directive preferences
  736. csharp_using_directive_placement = outside_namespace
  737. # Namespace naming preferences
  738. dotnet_style_namespace_match_folder = true
  739. # Undocumented preferences
  740. csharp_style_prefer_method_group_conversion = false
  741. csharp_style_prefer_top_level_statements = false
  742. ### Formatting rules ###
  743. ## .NET formatting options ##
  744. # Using directive options
  745. dotnet_sort_system_directives_first = true
  746. dotnet_separate_import_directive_groups = true
  747. ## C# formatting options ##
  748. # New-line options
  749. # TNIS-13005: Enabling this setting breaks Resharper indentation for lambdas
  750. #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
  751. csharp_new_line_before_else = true
  752. csharp_new_line_before_catch = true
  753. csharp_new_line_before_finally = true
  754. # Enabling this setting breaks Resharper formatting for an enum field reference that is
  755. # deeply nested in an object initializer.
  756. #
  757. # For an example, see TDataExchangeGeneralEnricher_CernInfrastructureObstruction.
  758. #csharp_new_line_before_members_in_object_initializers = true
  759. csharp_new_line_before_members_in_anonymous_types = true
  760. csharp_new_line_between_query_expression_clauses = true
  761. # Indentation options
  762. csharp_indent_case_contents = true
  763. csharp_indent_switch_labels = true
  764. csharp_indent_labels = one_less_than_current
  765. csharp_indent_block_contents = true
  766. # TNIS-13005: Enabling this setting breaks Resharper indentation for lambdas
  767. #csharp_indent_braces = false
  768. # TNIS-13005: Enabling this setting breaks Resharper indentation for lambdas
  769. #csharp_indent_case_contents_when_block = true
  770. # Spacing options
  771. csharp_space_after_cast = false
  772. csharp_space_after_keywords_in_control_flow_statements = true
  773. csharp_space_between_parentheses = false
  774. csharp_space_before_colon_in_inheritance_clause = true
  775. csharp_space_after_colon_in_inheritance_clause = true
  776. csharp_space_around_binary_operators = before_and_after
  777. csharp_space_between_method_declaration_parameter_list_parentheses = false
  778. csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
  779. csharp_space_between_method_declaration_name_and_open_parenthesis = false
  780. csharp_space_between_method_call_parameter_list_parentheses = false
  781. csharp_space_between_method_call_empty_parameter_list_parentheses = false
  782. csharp_space_between_method_call_name_and_opening_parenthesis = false
  783. csharp_space_after_comma = true
  784. csharp_space_before_comma = false
  785. csharp_space_after_dot = false
  786. csharp_space_before_dot = false
  787. csharp_space_after_semicolon_in_for_statement = true
  788. csharp_space_before_semicolon_in_for_statement = false
  789. csharp_space_around_declaration_statements = false
  790. csharp_space_before_open_square_brackets = false
  791. csharp_space_between_empty_square_brackets = false
  792. csharp_space_between_square_brackets = false
  793. # Wrap options
  794. csharp_preserve_single_line_statements = false
  795. csharp_preserve_single_line_blocks = true
  796. ### Naming styles ###
  797. # Naming rules
  798. dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
  799. dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
  800. dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
  801. dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
  802. dotnet_naming_rule.types_should_be_pascal_case.symbols = types
  803. dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
  804. dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
  805. dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
  806. dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
  807. dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.symbols = private_fields
  808. dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.style = camel_case_begins_with_underscore
  809. dotnet_naming_rule.private_fields_camel_case_begins_with_underscore.severity = warning
  810. dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.symbols = private_static_fields
  811. dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.style = camel_case_begins_with_underscore
  812. dotnet_naming_rule.private_static_fields_camel_case_begins_with_underscore.severity = warning
  813. dotnet_naming_rule.private_static_readonly_fields_pascal_case.symbols = private_static_readonly_fields
  814. dotnet_naming_rule.private_static_readonly_fields_pascal_case.style = pascal_case
  815. dotnet_naming_rule.private_static_readonly_fields_pascal_case.severity = warning
  816. dotnet_naming_rule.private_const_fields_pascal_case.symbols = private_const_fields
  817. dotnet_naming_rule.private_const_fields_pascal_case.style = pascal_case
  818. dotnet_naming_rule.private_const_fields_pascal_case.severity = warning
  819. # Symbol specifications
  820. dotnet_naming_symbols.interface.applicable_kinds = interface
  821. dotnet_naming_symbols.interface.applicable_accessibilities = *
  822. dotnet_naming_symbols.interface.required_modifiers =
  823. dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
  824. dotnet_naming_symbols.types.applicable_accessibilities = *
  825. dotnet_naming_symbols.types.required_modifiers =
  826. dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
  827. dotnet_naming_symbols.non_field_members.applicable_accessibilities = *
  828. dotnet_naming_symbols.non_field_members.required_modifiers =
  829. dotnet_naming_symbols.private_fields.applicable_kinds = field
  830. dotnet_naming_symbols.private_fields.applicable_accessibilities = private
  831. dotnet_naming_symbols.private_fields.required_modifiers =
  832. dotnet_naming_symbols.private_static_fields.applicable_kinds = field
  833. dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private
  834. dotnet_naming_symbols.private_static_fields.required_modifiers = static
  835. dotnet_naming_symbols.private_static_readonly_fields.applicable_kinds = field
  836. dotnet_naming_symbols.private_static_readonly_fields.applicable_accessibilities = private
  837. dotnet_naming_symbols.private_static_readonly_fields.required_modifiers = static, readonly
  838. dotnet_naming_symbols.private_const_fields.applicable_kinds = field
  839. dotnet_naming_symbols.private_const_fields.applicable_accessibilities = private
  840. dotnet_naming_symbols.private_const_fields.required_modifiers = const
  841. # Naming styles
  842. dotnet_naming_style.begins_with_i.required_prefix = I
  843. dotnet_naming_style.begins_with_i.required_suffix =
  844. dotnet_naming_style.begins_with_i.word_separator =
  845. dotnet_naming_style.begins_with_i.capitalization = pascal_case
  846. dotnet_naming_style.pascal_case.required_prefix =
  847. dotnet_naming_style.pascal_case.required_suffix =
  848. dotnet_naming_style.pascal_case.word_separator =
  849. dotnet_naming_style.pascal_case.capitalization = pascal_case
  850. dotnet_naming_style.camel_case_begins_with_underscore.required_prefix = _
  851. dotnet_naming_style.camel_case_begins_with_underscore.required_suffix =
  852. dotnet_naming_style.camel_case_begins_with_underscore.word_separator =
  853. dotnet_naming_style.camel_case_begins_with_underscore.capitalization = camel_case
  854. #### .NET Compiler Platform general options ####
  855. # Change the default rule severity for all analyzer rules that are enabled by default
  856. dotnet_analyzer_diagnostic.severity = warning
  857. #### .NET Compiler Platform code refactoring rules ####
  858. dotnet_style_operator_placement_when_wrapping = end_of_line
  859. #### ReSharper code style for C# ####
  860. ## Blank Lines
  861. resharper_csharp_blank_lines_around_region = 1
  862. resharper_csharp_blank_lines_inside_region = 1
  863. resharper_csharp_blank_lines_before_single_line_comment = 1
  864. resharper_csharp_keep_blank_lines_in_declarations = 1
  865. resharper_csharp_remove_blank_lines_near_braces_in_declarations = true
  866. resharper_csharp_blank_lines_after_start_comment = 1
  867. resharper_csharp_blank_lines_between_using_groups = 1
  868. resharper_csharp_blank_lines_after_using_list = 1
  869. resharper_csharp_blank_lines_around_namespace = 1
  870. resharper_csharp_blank_lines_inside_namespace = 0
  871. resharper_csharp_blank_lines_after_file_scoped_namespace_directive = 1
  872. resharper_csharp_blank_lines_around_type = 1
  873. resharper_csharp_blank_lines_around_single_line_type = 1
  874. resharper_csharp_blank_lines_inside_type = 0
  875. resharper_csharp_blank_lines_around_field = 0
  876. resharper_csharp_blank_lines_around_single_line_field = 0
  877. resharper_csharp_blank_lines_around_property = 1
  878. resharper_csharp_blank_lines_around_single_line_property = 1
  879. resharper_csharp_blank_lines_around_auto_property = 1
  880. resharper_csharp_blank_lines_around_single_line_auto_property = 1
  881. resharper_csharp_blank_lines_around_accessor = 0
  882. resharper_csharp_blank_lines_around_single_line_accessor = 0
  883. resharper_csharp_blank_lines_around_invocable = 1
  884. resharper_csharp_blank_lines_around_single_line_invocable = 1
  885. resharper_csharp_keep_blank_lines_in_code = 1
  886. resharper_csharp_remove_blank_lines_near_braces_in_code = true
  887. resharper_csharp_blank_lines_around_local_method = 1
  888. resharper_csharp_blank_lines_around_single_line_local_method = 1
  889. resharper_csharp_blank_lines_before_control_transfer_statements = 0
  890. resharper_csharp_blank_lines_after_control_transfer_statements = 0
  891. resharper_csharp_blank_lines_before_block_statements = 0
  892. resharper_csharp_blank_lines_after_block_statements = 1
  893. resharper_csharp_blank_lines_before_multiline_statements = 0
  894. resharper_csharp_blank_lines_after_multiline_statements = 0
  895. resharper_csharp_blank_lines_around_block_case_section = 0
  896. resharper_csharp_blank_lines_around_multiline_case_section = 0
  897. resharper_csharp_blank_lines_before_case = 0
  898. resharper_csharp_blank_lines_after_case = 0
  899. ## Braces Layout
  900. resharper_csharp_type_declaration_braces = next_line
  901. resharper_csharp_indent_inside_namespace = true
  902. resharper_csharp_invocable_declaration_braces = next_line
  903. resharper_csharp_anonymous_method_declaration_braces = next_line_shifted_2
  904. resharper_csharp_accessor_owner_declaration_braces = next_line
  905. resharper_csharp_accessor_declaration_braces = next_line
  906. resharper_csharp_case_block_braces = next_line_shifted_2
  907. resharper_csharp_initializer_braces = next_line_shifted_2
  908. resharper_csharp_use_continuous_indent_inside_initializer_braces = true
  909. resharper_csharp_other_braces = next_line
  910. resharper_csharp_allow_comment_after_lbrace = false
  911. resharper_csharp_empty_block_style = multiline
  912. ## Syntax Style
  913. # 'var' usage in declarations
  914. resharper_csharp_for_built_in_types = use_var
  915. resharper_csharp_for_simple_types = use_var
  916. resharper_csharp_for_other_types = use_var
  917. # Instance members qualification
  918. resharper_csharp_instance_members_qualify_members = none
  919. resharper_csharp_instance_members_qualify_declared_in = base_class
  920. # Static members qualification
  921. resharper_csharp_static_members_qualify_with = declared_type
  922. resharper_csharp_static_members_qualify_members = none
  923. # Built-in types
  924. resharper_csharp_builtin_type_reference_style = use_keyword
  925. resharper_csharp_builtin_type_reference_for_member_access_style = use_keyword
  926. # Reference qualification and 'using' directives
  927. resharper_csharp_prefer_qualified_reference = false
  928. resharper_csharp_add_imports_to_deepest_scope = false
  929. resharper_csharp_qualified_using_at_nested_scope = false
  930. resharper_csharp_allow_alias = true
  931. resharper_csharp_can_use_global_alias = true
  932. # Modifiers
  933. resharper_csharp_default_private_modifier = explicit
  934. resharper_csharp_default_internal_modifier = explicit
  935. resharper_csharp_modifiers_order = public private protected internal file static extern new virtual abstract sealed override readonly unsafe required volatile async
  936. # Braces
  937. resharper_csharp_braces_for_ifelse = required
  938. resharper_csharp_braces_for_for = required
  939. resharper_csharp_braces_for_foreach = required
  940. resharper_csharp_braces_for_while = required
  941. resharper_csharp_braces_for_dowhile = required
  942. resharper_csharp_braces_for_using = required
  943. resharper_csharp_braces_for_lock = required
  944. resharper_csharp_braces_for_fixed = required
  945. resharper_csharp_braces_redundant = false
  946. # Code body
  947. resharper_csharp_method_or_operator_body = block_body
  948. resharper_csharp_local_function_body = block_body
  949. resharper_csharp_constructor_or_destructor_body = block_body
  950. resharper_csharp_accessor_owner_body = accessors_with_block_body
  951. resharper_csharp_namespace_body = block_scoped
  952. resharper_csharp_use_heuristics_for_body_style = false
  953. # Trailing comma
  954. resharper_csharp_trailing_comma_in_multiline_lists = false
  955. resharper_csharp_trailing_comma_in_singleline_lists = false
  956. # Object creation
  957. resharper_csharp_object_creation_when_type_evident = explicitly_typed
  958. resharper_csharp_object_creation_when_type_not_evident = explicitly_typed
  959. # Default value
  960. resharper_csharp_default_value_when_type_evident = default_literal
  961. resharper_csharp_default_value_when_type_not_evident = default_literal
  962. ## Tabs, Indents, Alignment
  963. # Nested statements
  964. resharper_csharp_indent_nested_usings_stmt = false
  965. resharper_csharp_indent_nested_fixed_stmt = false
  966. resharper_csharp_indent_nested_lock_stmt = false
  967. resharper_csharp_indent_nested_for_stmt = true
  968. resharper_csharp_indent_nested_foreach_stmt = true
  969. resharper_csharp_indent_nested_while_stmt = true
  970. # Parenthesis
  971. resharper_csharp_use_continuous_indent_inside_parens = true
  972. resharper_csharp_indent_method_decl_pars = outside_and_inside
  973. resharper_csharp_indent_invocation_pars = outside_and_inside
  974. resharper_csharp_indent_statement_pars = outside_and_inside
  975. resharper_csharp_indent_typeparam_angles = outside_and_inside
  976. resharper_csharp_indent_typearg_angles = outside_and_inside
  977. resharper_csharp_indent_pars = outside_and_inside
  978. # Preprocessor directives
  979. resharper_csharp_indent_preprocessor_if = no_indent
  980. resharper_csharp_indent_preprocessor_region = usual_indent
  981. resharper_csharp_indent_preprocessor_other = no_indent
  982. # Other indents
  983. resharper_indent_switch_labels = true
  984. resharper_csharp_outdent_statement_labels = true
  985. resharper_csharp_indent_type_constraints = true
  986. resharper_csharp_stick_comment = false
  987. resharper_csharp_place_comments_at_first_column = false
  988. resharper_csharp_use_indent_from_previous_element = true
  989. resharper_csharp_indent_braces_inside_statement_conditions = true
  990. # Align multiline constructs
  991. resharper_csharp_alignment_tab_fill_style = use_spaces
  992. resharper_csharp_allow_far_alignment = true
  993. resharper_csharp_align_multiline_parameter = true
  994. resharper_csharp_align_multiline_extends_list = true
  995. resharper_csharp_align_linq_query = true
  996. resharper_csharp_align_multiline_binary_expressions_chain = true
  997. resharper_csharp_outdent_binary_ops = false
  998. resharper_csharp_align_multiline_calls_chain = true
  999. resharper_csharp_outdent_dots = false
  1000. resharper_csharp_align_multiline_array_and_object_initializer = false
  1001. resharper_csharp_align_multiline_switch_expression = false
  1002. resharper_csharp_align_multiline_property_pattern = false
  1003. resharper_csharp_align_multiline_list_pattern = false
  1004. resharper_csharp_align_multiline_binary_patterns = false
  1005. resharper_csharp_outdent_binary_pattern_ops = false
  1006. resharper_csharp_indent_anonymous_method_block = true
  1007. resharper_csharp_align_first_arg_by_paren = false
  1008. resharper_csharp_align_multiline_argument = true
  1009. resharper_csharp_align_tuple_components = true
  1010. resharper_csharp_align_multiline_expression = true
  1011. resharper_csharp_align_multiline_statement_conditions = true
  1012. resharper_csharp_align_multiline_for_stmt = true
  1013. resharper_csharp_align_multiple_declaration = true
  1014. resharper_csharp_align_multline_type_parameter_list = true
  1015. resharper_csharp_align_multline_type_parameter_constrains = true
  1016. resharper_csharp_outdent_commas = false
  1017. ## Line Breaks
  1018. # General
  1019. resharper_csharp_keep_user_linebreaks = true
  1020. resharper_csharp_max_line_length = 140
  1021. resharper_csharp_wrap_before_comma = false
  1022. resharper_csharp_wrap_before_eq = false
  1023. resharper_csharp_special_else_if_treatment = true
  1024. resharper_csharp_insert_final_newline = true
  1025. # Arrangement of attributes
  1026. resharper_csharp_keep_existing_attribute_arrangement = false
  1027. resharper_csharp_place_type_attribute_on_same_line = false
  1028. resharper_csharp_place_method_attribute_on_same_line = false
  1029. resharper_csharp_place_accessorholder_attribute_on_same_line = false
  1030. resharper_csharp_place_accessor_attribute_on_same_line = false
  1031. resharper_csharp_place_field_attribute_on_same_line = false
  1032. resharper_csharp_place_record_field_attribute_on_same_line = true
  1033. # Arrangement of method signatures
  1034. resharper_csharp_place_constructor_initializer_on_same_line = false
  1035. resharper_csharp_place_expr_method_on_single_line = true
  1036. resharper_csharp_place_expr_property_on_single_line = true
  1037. resharper_csharp_place_expr_accessor_on_single_line = true
  1038. # Arrangement of type parameters, constraints, and base types
  1039. resharper_csharp_place_type_constraints_on_same_line = false
  1040. resharper_csharp_wrap_before_first_type_parameter_constraint = true
  1041. # Arrangement of declaration blocks
  1042. resharper_csharp_place_abstract_accessorholder_on_single_line = true
  1043. # Arrangement of statements
  1044. resharper_new_line_before_else = true
  1045. resharper_new_line_before_while = true
  1046. resharper_new_line_before_catch = true
  1047. resharper_new_line_before_finally = true
  1048. resharper_wrap_for_stmt_header_style = chop_if_long
  1049. resharper_wrap_multiple_declaration_style = chop_always
  1050. ## Spaces
  1051. # Preserve existing formatting
  1052. resharper_csharp_extra_spaces = remove_all
  1053. # Before parentheses in statements
  1054. resharper_csharp_space_before_if_parentheses = true
  1055. resharper_csharp_space_before_while_parentheses = true
  1056. resharper_csharp_space_before_catch_parentheses = true
  1057. resharper_csharp_space_before_switch_parentheses = true
  1058. resharper_csharp_space_before_for_parentheses = true
  1059. resharper_csharp_space_before_foreach_parentheses = true
  1060. resharper_csharp_space_before_using_parentheses = true
  1061. resharper_csharp_space_before_lock_parentheses = true
  1062. resharper_csharp_space_before_fixed_parentheses = true
  1063. # Before other parentheses
  1064. resharper_csharp_space_before_method_call_parentheses = false
  1065. resharper_csharp_space_before_empty_method_call_parentheses = false
  1066. resharper_csharp_space_before_method_parentheses = false
  1067. resharper_csharp_space_before_empty_method_parentheses = false
  1068. resharper_csharp_space_before_typeof_parentheses = false
  1069. resharper_csharp_space_before_default_parentheses = false
  1070. resharper_csharp_space_before_checked_parentheses = false
  1071. resharper_csharp_space_before_sizeof_parentheses = false
  1072. resharper_csharp_space_before_nameof_parentheses = false
  1073. resharper_csharp_space_before_new_parentheses = false
  1074. resharper_csharp_space_between_keyword_and_expression = true
  1075. resharper_csharp_space_between_keyword_and_type = false
  1076. # Within parentheses in statements
  1077. resharper_csharp_space_within_if_parentheses = false
  1078. resharper_csharp_space_within_while_parentheses = false
  1079. resharper_csharp_space_within_catch_parentheses = false
  1080. resharper_csharp_space_within_switch_parentheses = false
  1081. resharper_csharp_space_within_for_parentheses = false
  1082. resharper_csharp_space_within_foreach_parentheses = false
  1083. resharper_csharp_space_within_using_parentheses = false
  1084. resharper_csharp_space_within_lock_parentheses = false
  1085. resharper_csharp_space_within_fixed_parentheses = false
  1086. # Within other parentheses
  1087. resharper_csharp_space_within_parentheses = false
  1088. resharper_csharp_space_between_typecast_parentheses = false
  1089. resharper_csharp_space_between_method_declaration_parameter_list_parentheses = false
  1090. resharper_csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
  1091. resharper_csharp_space_between_method_call_parameter_list_parentheses = false
  1092. resharper_csharp_space_between_method_call_empty_parameter_list_parentheses = false
  1093. resharper_csharp_space_within_typeof_parentheses = false
  1094. resharper_csharp_space_within_default_parentheses = false
  1095. resharper_csharp_space_within_checked_parentheses = false
  1096. resharper_csharp_space_within_sizeof_parentheses = false
  1097. resharper_csharp_space_within_nameof_parentheses = false
  1098. resharper_csharp_space_within_new_parentheses = false
  1099. # Around array brackets
  1100. resharper_csharp_space_before_array_access_brackets = false
  1101. resharper_csharp_space_before_open_square_brackets = false
  1102. resharper_csharp_space_before_array_rank_brackets = false
  1103. resharper_csharp_space_within_array_access_brackets = false
  1104. resharper_csharp_space_between_square_brackets = false
  1105. resharper_csharp_space_within_array_rank_brackets = false
  1106. resharper_csharp_space_within_array_rank_empty_brackets = false
  1107. resharper_csharp_space_between_empty_square_bracket = false
  1108. # Around angle brackets
  1109. resharper_csharp_space_before_type_parameter_angle = false
  1110. resharper_csharp_space_before_type_argument_angle = false
  1111. resharper_csharp_space_within_type_parameter_angles = false
  1112. resharper_csharp_space_within_type_argument_angles = false
  1113. ### ReSharper code style for XMLDOC ###
  1114. ## Tabs and indents
  1115. resharper_xmldoc_indent_style = space
  1116. # ReSharper currently ignores this setting. See https://youtrack.jetbrains.com/issue/RSRP-465678/XMLDOC-indent-settings-ignored.
  1117. resharper_xmldoc_indent_size = 2
  1118. resharper_xmldoc_tab_width = 2
  1119. resharper_xmldoc_alignment_tab_fill_style = use_spaces
  1120. resharper_xmldoc_allow_far_alignment = true
  1121. ## Line wrapping
  1122. resharper_xmldoc_max_line_length = 140
  1123. resharper_xmldoc_wrap_tags_and_pi = false
  1124. ## Processing instructions
  1125. resharper_xmldoc_spaces_around_eq_in_pi_attribute = false
  1126. resharper_xmldoc_space_after_last_pi_attribute = false
  1127. resharper_xmldoc_pi_attribute_style = on_single_line
  1128. resharper_xmldoc_pi_attributes_indent = align_by_first_attribute
  1129. resharper_xmldoc_blank_line_after_pi = false
  1130. ## Inside of tag header
  1131. resharper_xmldoc_spaces_around_eq_in_attribute = false
  1132. resharper_xmldoc_space_after_last_attribute = false
  1133. resharper_xmldoc_space_before_self_closing = false
  1134. resharper_xmldoc_attribute_style = do_not_touch
  1135. resharper_xmldoc_attribute_indent = align_by_first_attribute
  1136. ## Tag content
  1137. resharper_xmldoc_keep_user_linebreaks = true
  1138. resharper_xmldoc_linebreaks_inside_tags_for_multiline_elements = true
  1139. resharper_xmldoc_linebreaks_inside_tags_for_elements_with_child_elements = false
  1140. resharper_xmldoc_spaces_inside_tags = false
  1141. resharper_xmldoc_wrap_text = false
  1142. resharper_xmldoc_wrap_around_elements = false
  1143. # ReSharper currently ignores the 'resharper_xmldoc_indent_size' setting. Once https://youtrack.jetbrains.com/issue/RSRP-465678/XMLDOC-indent-settings-ignored
  1144. # is fixed, we should change the value of this setting to 'one_indent'.
  1145. resharper_xmldoc_indent_child_elements = zero_indent
  1146. resharper_xmldoc_indent_text = zero_indent
  1147. ## Around tags
  1148. resharper_xmldoc_max_blank_lines_between_tags = 1
  1149. resharper_xmldoc_linebreak_before_multiline_elements = true
  1150. resharper_xmldoc_linebreak_before_singleline_elements = false
  1151. [*.{xml,xsd,csproj,targets,proj,props,runsettings,config}]
  1152. #### ReSharper code style for XML ####
  1153. ## Tabs and indents
  1154. resharper_xml_indent_style = space
  1155. resharper_xml_indent_size = 4
  1156. resharper_xml_tab_width = 4
  1157. resharper_xml_alignment_tab_fill_style = use_spaces
  1158. resharper_xml_allow_far_alignment = true
  1159. ## Line wrapping
  1160. resharper_xml_wrap_tags_and_pi = false
  1161. ## Processing instructions
  1162. resharper_xml_spaces_around_eq_in_pi_attribute = false
  1163. resharper_xml_space_after_last_pi_attribute = false
  1164. resharper_xml_pi_attribute_style = on_single_line
  1165. resharper_xml_pi_attributes_indent = align_by_first_attribute
  1166. resharper_xml_blank_line_after_pi = false
  1167. ## Inside of tag header
  1168. resharper_xml_spaces_around_eq_in_attribute = false
  1169. resharper_xml_space_after_last_attribute = false
  1170. resharper_xml_space_before_self_closing = true
  1171. resharper_xml_attribute_style = do_not_touch
  1172. resharper_xml_attribute_indent = align_by_first_attribute
  1173. ## Tag content
  1174. resharper_xml_keep_user_linebreaks = true
  1175. resharper_xml_linebreaks_inside_tags_for_multiline_elements = false
  1176. resharper_xml_linebreaks_inside_tags_for_elements_with_child_elements = false
  1177. resharper_xml_linebreaks_inside_tags_for_elements_longer_than = false
  1178. resharper_xml_spaces_inside_tags = false
  1179. resharper_xml_wrap_text = false
  1180. resharper_xml_wrap_around_elements = false
  1181. resharper_xml_indent_child_elements = one_indent
  1182. resharper_xml_indent_text = zero_indent
  1183. resharper_xml_max_blank_lines_between_tags = 1
  1184. resharper_xml_linebreak_before_multiline_elements = false
  1185. resharper_xml_linebreak_before_singleline_elements = false
  1186. ## Other
  1187. resharper_xml_insert_final_newline = true