.editorconfig 52 KB

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