Depscheck (Depscheck v1.0.12)

View Source

A tool for checking dependency license compatibility in Elixir projects.

Depscheck helps ensure your project's dependencies have compatible licenses by reading license information from local hex_metadata.config files and checking them against your project's license.

Usage

Run the Mix task:

mix depscheck

Or use the API directly:

Depscheck.check()

Configuration

Create a .depscheck.exs file in your project root to ignore specific packages:

%{
  ignored_packages: ["some_package", "another_package"]
}

License Compatibility

See LICENSE_COMPATIBILITY_RULES.md for detailed information about how license compatibility is determined.

Summary

Functions

Checks all dependencies for license compatibility.

Gets all dependency licenses.

Gets the project's license from mix.exs.

Functions

check()

@spec check() :: Depscheck.Types.check_result()

Checks all dependencies for license compatibility.

Returns a check_result map with status and violations.

Examples

iex> result = Depscheck.check()
iex> result.status
:pass

dependencies()

@spec dependencies() :: [Depscheck.Types.dependency()]

Gets all dependency licenses.

Examples

iex> deps = Depscheck.dependencies()
iex> is_list(deps)
true

project_license()

@spec project_license() :: String.t() | nil

Gets the project's license from mix.exs.

Returns the first license if multiple are declared, or nil if none found.

Examples

iex> license = Depscheck.project_license()
iex> is_binary(license) or is_nil(license)
true