Depscheck.LicenseAliases (Depscheck v1.0.12)

View Source

Maps license spelling variations and aliases to canonical license names.

This module provides a centralized mapping of common license name variations (e.g., "Apache v2.0", "GPLv2", "APL 2.0") to their canonical forms (e.g., "Apache-2.0", "GPL-2.0").

Usage

The aliases are used during license normalization to ensure that different spellings of the same license are correctly identified.

Examples

iex> Depscheck.LicenseAliases.resolve("apache-v2.0")
"apache-2-0"

iex> Depscheck.LicenseAliases.resolve("gplv2")
"gpl-2-0"

iex> Depscheck.LicenseAliases.resolve("apl-2.0")
"apache-2-0"

Summary

Functions

Resolves a normalized license name to its canonical form.

Functions

resolve(normalized_name)

@spec resolve(String.t()) :: String.t()

Resolves a normalized license name to its canonical form.

Returns the canonical license name if an alias exists, otherwise returns the input unchanged.

Examples

iex> Depscheck.LicenseAliases.resolve("apache-v2.0")
"apache-2.0"

iex> Depscheck.LicenseAliases.resolve("gplv2")
"gpl-2.0"

iex> Depscheck.LicenseAliases.resolve("unknown-license")
"unknown-license"