Skip to content

Instantly share code, notes, and snippets.

View VacuumBreather's full-sized avatar

Andreas Schmitt VacuumBreather

View GitHub Profile
@VacuumBreather
VacuumBreather / Resharper_Rider_CS_FileLayout_NoRegions.xml
Last active January 13, 2025 06:13
Rider / Resharper .cs file layout (no regions)
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
<!-- Non-reorderable types -->
<TypePattern DisplayName="Non-reorderable types" Priority="99999999">
<TypePattern.Match>
<Or>
<And>
<Kind Is="Interface" />
<Or>
<HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" />
@VacuumBreather
VacuumBreather / .editorconfig
Last active January 13, 2025 06:18
Unity Project .editorconfig
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = false
indent_style = space
indent_size = 4
@VacuumBreather
VacuumBreather / .gitattributes
Created January 12, 2025 23:36
.gitattributes file for Unity projects using Git LFS
# Treat everything not text if not specified
# Avoid crlf messing up things like .asset and ProjectSettings (But we'd like to diff so we do not assign binary[-text -diff] tag)
# You should never do line ending conversion on .asset, .asset could be CRLF(ProjectSettings) LF(Tile set config) or binary even if forced text(Lighting, Terrain and NavMesh Data)
* -text
# Unity visible meta is LF regardless of created platform
*.meta text eol=lf
# All extensions are specified in lower cases
# [git config core.ignorecase true] is assumed.
@VacuumBreather
VacuumBreather / pre-commit
Created January 12, 2025 23:34
pre-commit hook to check for large files that should be tracked by LFS
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
# Redirect output to stderr.
@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 13, 2025 05:40
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 March 10, 2025 09:56
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">
<!-- StyleCop Unity Classes Layout -->
<TypePattern DisplayName="StyleCop Unity Classes Layout" RemoveRegions="All" Priority="150">
<TypePattern.Match>
<unity:SerializableClass />
</TypePattern.Match>
<Region Name="Constants and Fields">
<Entry DisplayName="Constants">
@VacuumBreather
VacuumBreather / CsFileLayout.xml
Last active January 13, 2025 06:13
Resharper/Rider C# File Layout
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
<!-- Non-reorderable types -->
<TypePattern DisplayName="Non-reorderable types" Priority="99999999">
<TypePattern.Match>
<Or>
<And>
<Kind Is="Interface" />
<Or>
<HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" />
/// <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")]