manuelroemer / Nullable

A source code only package which allows you to use .NET's nullable attributes in older target frameworks like .NET Standard 2.0 or the "old" .NET Framework.
https://www.nuget.org/packages/Nullable
MIT License
184 stars 8 forks source link

Add auto-generated tag to exclude file from analysis #4

Closed skarllot closed 4 years ago

skarllot commented 4 years ago

The included file is currently analysed and can lead to some warnings according to analyzer configuration.

manuelroemer commented 4 years ago

Hey, thank you for this, this is a nice change! I'll merge and push it as soon as I can get to it (currently busy with work).

One question: Can you update the file to begin like this? This would make it faster for me later on. If you don't have the time, that's fine too - I can also do it.

// <auto-generated>
//   This code file has automatically been added by the "Nullable" NuGet package (https://www.nuget.org/packages/Nullable).
//   Please see https://github.com/manuelroemer/Nullable for more information.
// </auto-generated>

#region License
// MIT License
// 
// Copyright (c) 2019 Manuel Römer
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#endregion

#if !NULLABLE_ATTRIBUTES_DISABLE
#nullable enable

namespace System.Diagnostics.CodeAnalysis
{
    using global::System;
...

This puts the <auto-generated/> at the top of the file (I think other tools also do it like this). Thank you very much!

skarllot commented 4 years ago

@manuelroemer done

manuelroemer commented 4 years ago

Thank you! I will merge it now and publish it to NuGet tomorrow-ish. I will notify you once the new packe has been uploaded.

manuelroemer commented 4 years ago

@skarllot I decided to update right now - your changes are live on NuGet. I also mentioned you and your change in the changelog. Feel free to notify me if your GitHub name ever changes, so that I can update the document.