Depscheck.Compatibility (Depscheck v1.0.12)

View Source

Checks license compatibility between project and dependencies.

Implements the compatibility rules defined in LICENSE_COMPATIBILITY_RULES.md

Summary

Functions

Checks all dependencies against the project license.

Checks if a dependency license is compatible with the project license.

Functions

check_all(project_license, dependencies, config)

Checks all dependencies against the project license.

Returns a check_result map with status and violations.

check_compatibility(project_license, dep_license)

@spec check_compatibility(String.t() | nil, String.t()) ::
  :compatible | {:incompatible, String.t()}

Checks if a dependency license is compatible with the project license.

Returns :compatible or {:incompatible, reason}.

Examples

iex> Depscheck.Compatibility.check_compatibility("MIT", "Apache-2.0")
:compatible

iex> Depscheck.Compatibility.check_compatibility("MIT", "GPL-3.0")
{:incompatible, "Strong copyleft license GPL-3.0 cannot be used in permissive project"}