.editorconfig 52 KB

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