Skip to content

Conversation

@kzu
Copy link
Member

@kzu kzu commented Feb 28, 2023

Provided analyzers:

Diagnostic ID Description
NG0101 The default description set by the .NET SDK ('Package Description') is being used for your package. This will look poorly in the NuGet gallery.
NG0102 The Description property used for the package must be up to 4000 characters long.
NG0103 The PackageIcon project property can specify the path to a JPEG or PNG file to use as the package icon, which will be automatically packed properly.
NG0104 Setting the PackageReadmeFile project property is enough to get the file packed properly.
NG0105 Set the PackageLicenseExpression project property to an accepted value such as 'MIT' or 'Apache-2.0'. See accepted values at https://spdx.org/licenses/.
NG0106 Provide a short description of your package for improved discoverability.
NG0107 Source Link is the recommended way to automatically include this information. Install the relevant NuGet package for your source control provider (such as GitHub, AzureRepos, GitLab, etc.) and NuGetizer will automatically use the provided information.
NG0108 This should be a publicly available url that can be invoked directly by a version control software. Populated automatically when setting the PublishRepositoryUrl project property to 'true' and using SourceLink.
NG0109 Make sure PackageProjectUrl is an actual homepage users can navigate to directly from nuget.org. RepositoryUrl, on the other hand, is intended for version control software.
NG0110 Source Link is the recommended way to automatically include source information with your package. Install the relevant NuGet package for your source control provider (such as GitHub, AzureRepos, GitLab, etc.) and NuGetizer will automatically use the provided information.
NG0111 When EmbedUntrackedSources is set to 'true', Source Link will embed in your PDB the items that participated in the compile, but not are included in source control.

kzu added 6 commits February 28, 2023 00:43
Warning for default description found, info for missing icon.
Issues an Info if a license isn't specified and an error if duplicate attributes are used.
Suggest installing SourceLink, setting PublishRepositoryUrl and having a sensible user-facing URL value for PackageProjectUrl.
Only while packing, since we don't want to annoy users with those for regular non-packing builds.
Makes it consistent with the diagnostics we emit, as well as build warnings.
@kzu kzu added the enhancement New feature or request label Feb 28, 2023
@kzu kzu enabled auto-merge (rebase) February 28, 2023 21:38
@kzu kzu merged commit 3b1936b into main Feb 28, 2023
@kzu kzu deleted the dev/BestPracticeAnalyzers branch February 28, 2023 22:07
@devlooped devlooped locked and limited conversation to collaborators Nov 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants