Depscheck.LicenseKnowledge (Depscheck v1.0.12)

View Source

Knowledge base of software licenses and their categories.

This module provides license categorization for compatibility checking.

Summary

Functions

Returns true if the license is copyleft (weak or strong).

Returns the category for a given license name.

Lists all licenses in a given category.

Returns true if the license is permissive.

Returns true if the license is proprietary.

Functions

copyleft?(license_name)

@spec copyleft?(String.t()) :: boolean()

Returns true if the license is copyleft (weak or strong).

Examples

iex> Depscheck.LicenseKnowledge.copyleft?("GPL-3.0")
true

iex> Depscheck.LicenseKnowledge.copyleft?("LGPL-3.0")
true

iex> Depscheck.LicenseKnowledge.copyleft?("MIT")
false

get_category(license_name)

@spec get_category(String.t()) :: Depscheck.Types.license_category()

Returns the category for a given license name.

Examples

iex> Depscheck.LicenseKnowledge.get_category("MIT")
:permissive

iex> Depscheck.LicenseKnowledge.get_category("GPL-3.0")
:strong_copyleft

iex> Depscheck.LicenseKnowledge.get_category("Unknown-License")
:unknown

list_licenses_by_category(atom)

@spec list_licenses_by_category(Depscheck.Types.license_category()) :: [String.t()]

Lists all licenses in a given category.

Examples

iex> Depscheck.LicenseKnowledge.list_licenses_by_category(:permissive)
["MIT", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause", "BSD-4-Clause", "BSD-0-Clause", "0BSD", "ISC", "Unlicense", "CC0-1.0"]

permissive?(license_name)

@spec permissive?(String.t()) :: boolean()

Returns true if the license is permissive.

Examples

iex> Depscheck.LicenseKnowledge.permissive?("MIT")
true

iex> Depscheck.LicenseKnowledge.permissive?("GPL-3.0")
false

proprietary?(license_name)

@spec proprietary?(String.t()) :: boolean()

Returns true if the license is proprietary.

Examples

iex> Depscheck.LicenseKnowledge.proprietary?("All Rights Reserved")
true

iex> Depscheck.LicenseKnowledge.proprietary?("MIT")
false