Skip to content

Some ideas #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Thieum opened this issue Feb 3, 2022 · 1 comment
Open

Some ideas #3

Thieum opened this issue Feb 3, 2022 · 1 comment

Comments

@Thieum
Copy link

Thieum commented Feb 3, 2022

That checklist is a great idea! Here are a few points I usually set in my own libraries/apps, some with retro-compatibility requirements, I mostly wonder if it could be useful outside of my context, so it's more an open discussion than an issue :)

  • Enabling default code analyzers:
    <EnableNETAnalyzers>true</EnableNETAnalyzers>
    <AnalysisLevel>latest</AnalysisLevel>
    <AnalysisMode>AllEnabledByDefault</AnalysisMode>

Rationale: you want to fix or document any warning.

  • Explicit Lang Version:
   <LangVersion>10</LangVersion>

Rationale: To avoid any conflict, and with latest version, you get extra help to modernize code.

  • Restore Package with lock files:
  <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>

Rationale: best explained here: https://devblogs.microsoft.com/nuget/enable-repeatable-package-restores-using-a-lock-file/

  • Explicit Root Namespace:
   <RootNamespace>FooBar</RootNamespace>

Rationale: to avoid an output rename that would conflict with existing code (more appropriate for exe than lib ?)

  • Explicit value for EmbeddedResourceUseDependentUponConvention:
   <EmbeddedResourceUseDependentUponConvention>true</EmbeddedResourceUseDependentUponConvention>

Rationale: needed for multitarget to .net framework when using resx.

  • Explicit CheckForOverflowUnderflow in Debug
   <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>

Rationale: default is false: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/language#checkforoverflowunderflow but still better safe than sorry, and add explicit bypass in code if needed

  • Documentation File
   <DocumentationFile>..\bin\$(Configuration)\FooBar.xml</DocumentationFile>

Rationale: boring but useful for libraries.

-Treat Warning as Error in Release

   <TreatWarningsAsErrors>true</TreatWarningsAsErrors>

Rationale: effective way to keep the count low.

  • Add a .editorconfig, and set what is needed to keep a consistent style.
@Turnerj
Copy link
Owner

Turnerj commented Feb 4, 2022

Thanks for the ideas! There is definitely a few I'll add!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants