SPDX.CodeAnalysis
1.0.0-alpha.227.ge02bdf10b4
dotnet add package SPDX.CodeAnalysis --version 1.0.0-alpha.227.ge02bdf10b4
NuGet\Install-Package SPDX.CodeAnalysis -Version 1.0.0-alpha.227.ge02bdf10b4
<PackageReference Include="SPDX.CodeAnalysis" Version="1.0.0-alpha.227.ge02bdf10b4" />
<PackageVersion Include="SPDX.CodeAnalysis" Version="1.0.0-alpha.227.ge02bdf10b4" />
<PackageReference Include="SPDX.CodeAnalysis" />
paket add SPDX.CodeAnalysis --version 1.0.0-alpha.227.ge02bdf10b4
#r "nuget: SPDX.CodeAnalysis, 1.0.0-alpha.227.ge02bdf10b4"
#:package SPDX.CodeAnalysis@1.0.0-alpha.227.ge02bdf10b4
#addin nuget:?package=SPDX.CodeAnalysis&version=1.0.0-alpha.227.ge02bdf10b4&prerelease
#tool nuget:?package=SPDX.CodeAnalysis&version=1.0.0-alpha.227.ge02bdf10b4&prerelease
License Header Enforcement for OSS Projects
This package provides Roslyn code analyzers to enforce specifying headers in .cs files similar to:
// SPDX-FileCopyrightText: Copyright 2025-2028 John Smith
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
or:
// SPDX-FileCopyrightText: Copyright 2025-2028 John Smith
// SPDX-License-Identifier: MIT
//
// 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.
This analyzer does basic checks to ensure that your .cs files:
- Contain the
SPDX-FileCopyrightText
tag - Contain the
SPDX-License-Identifier
tag - The
SPDX-License-Identifier
matches sample text from the license
This is just to generate warnings during compile time for ease of maintenance. For more robust validation use REUSE during CI.
NuGet
Saying Thanks
If you find these libraries to be useful, please star us on GitHub and consider a sponsorship so we can continue bringing you great free tools like these. It really would make a big difference!
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.0-alpha.227.ge02bdf10b4 | 139 | 9/4/2025 |
1.0.0-alpha.155 | 128 | 9/24/2025 |