Skip to main content

LegalLint: A Multi-Language License Compliance Linter

Project description

LegalLint

LegalLint is a license compliance linter for all programming languages, with current support for Python. It ensures that projects adhere to specified licensing policies, allowing users to enforce allowed licenses and trigger errors for disallowed licenses.

Features

  • Detects license types for Python libraries.
  • Customizable allowed and disallowed licenses.
  • Skips specific libraries from license checking.
  • TOML-based configuration for flexible settings.

Installation

To install LegalLint:

pip install legallint

Usage

CLI

$ legallint -l python

Example Configuration (legallint.yaml)

allowed_licenses:
  - MIT
  - Apache-2.0
  - BSD-3-Clause

trigger_error_licenses:
  - GPL-3.0
  - AGPL-3.0
  - Proprietary
  - Unknown

skip_libraries:

Example Configuration for python (pyproject.toml)

[licenses]
allowed = ["MIT", "Apache-2.0", "BSD-3-Clause"]
trigger_error = ["GPL-3.0", "AGPL-3.0", "Proprietary", "Unknown"]

# Libraries to skip
skip_libraries = ["example-lib1", "example-lib2"]

Example legallint result

% legallint -l python
---------------
   PYTHON
---------------
✔     iniconfig            MIT
✔     requests             Apache; Apache-2.0
✔     tomli                MIT
✔     charset-normalizer   MIT
✔     idna                 BSD
✔     exceptiongroup       MIT
✔     pytest               MIT
✔     pyyaml               MIT
✔     pip                  MIT
‼     certifi              MPL; MPL-2.0
✔     toml                 MIT
✔     pluggy               MIT
✔     packaging            BSD; Apache
✔     setuptools           MIT
✔     urllib3              MIT
LegalLint: License compliance warning.
% 

legallint commands

$ legallint -h
usage: legallint [-h] [--verbose] [-v] [-l {python,node} [{python,node} ...]] [-u] [--license]

LegalLint is a cross-platform tool designed to ensure license compliance across multiple programming languages by analyzing dependencies and enforcing predefined license policies. LegalLint helps maintain legal standards by scanning the project’s dependencies and ensuring that only approved licenses (e.g., MIT, Apache 2.0) are used.

options:
  -h, --help            show this help message and exit
  --verbose             Enable verbose mode
  -v, --version         show program's version number and exit
  -l {python,node} [{python,node} ...], --lang {python,node} [{python,node} ...]
                        Select one or more languages from: python
  -u, --update          Enable update mode
  --license             Enable license mode

License

LegalLint is distributed under the Apache-2.0 License. See LICENSE for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

legallint-1.1.0.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

legallint-1.1.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file legallint-1.1.0.tar.gz.

File metadata

  • Download URL: legallint-1.1.0.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Darwin/23.6.0

File hashes

Hashes for legallint-1.1.0.tar.gz
Algorithm Hash digest
SHA256 8db295096bfacf594390780c0caeaa824162d3ad1abf50d6ec2d3fbdb7e9f414
MD5 3bdcbe7844e3db7a1054262ec96edf02
BLAKE2b-256 66370060fec9b1cfee4a0a8759dcd933cb914c64c1b2d92f376d51556e250b7a

See more details on using hashes here.

File details

Details for the file legallint-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: legallint-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.6 Darwin/23.6.0

File hashes

Hashes for legallint-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98a4712c1073403c4499c325aebf62af58b8cc24930efb98a2b7423afcc1c50a
MD5 d38baafbd606b72f92b68ab2434949a2
BLAKE2b-256 0a61227ba8eb14f42ecaec3c4a6e3901a129c436363e4e3db50e5d29625b5e63

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page