Skip to content

Instantly share code, notes, and snippets.

View VacuumBreather's full-sized avatar

Andreas Schmitt VacuumBreather

View GitHub Profile
@VacuumBreather
VacuumBreather / Directory.Build.props
Last active December 6, 2023 22:05
Directory.Build.props containing analyzer nuget package setup
<Project>
<PropertyGroup>
<NoWarn>CA1062</NoWarn>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AsyncFixer" Version="1.6.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@VacuumBreather
VacuumBreather / .editorconfig
Created December 6, 2023 22:03
.editorconfig handling diagnostic severities
# NOTE: Requires **VS2019 16.3** or later
# StyleCop.Analyzers rules with default action
# Description: StyleCop.Analyzers with default action. Rules with IsEnabledByDefault = false are disabled.
# Code files
[*.{cs,vb}]
# Use the LoggerMessage delegates
@VacuumBreather
VacuumBreather / .editorconfig
Last active January 3, 2024 13:47
Standard .editorconfig for C#
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
[*]
charset = utf-8-bom
end_of_line = crlf
trim_trailing_whitespace = true
insert_final_newline = false
indent_style = space
indent_size = 4
@VacuumBreather
VacuumBreather / CsUnityFileLayout.xml
Last active December 6, 2023 21:59
Rider C# File Layout for Unity classes
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"
xmlns:unity="urn:schemas-jetbrains-com:member-reordering-patterns-unity">
<!-- Pattern to match classes used by Unity that contain serialised fields
and event function methods. Based on the standard "Default Pattern",
this will also order event functions before normal methods, and does
not reorder serialised fields, as this order is reflected in the Unity
editor's Inspector -->
<TypePattern DisplayName="Unity classes" Priority="100">
<TypePattern.Match>
@VacuumBreather
VacuumBreather / CsFileLayout.xml
Last active January 3, 2024 12:55
Resharper/Rider C# File Layout
<?xml version="1.0" encoding="utf-16"?>
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
<!-- Non-reorderable types -->
<TypePattern DisplayName="Non-reorderable types">
<TypePattern.Match>
<Or>
<And>
<Kind Is="Interface" />
/// <summary>
/// Static helper class to debug failed MEF composition.
/// </summary>
public static class MefDebuggingHelper
{
/// <summary>
/// Writes missing import definitions to the debug console.
/// </summary>
/// <param name="container"></param>
[Conditional("DEBUG")]