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 (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"]
$ legallint -l python
---------------
   PYTHON
---------------
✔     toml                 MIT
✔     pluggy               MIT
✔     iniconfig            MIT
✔     packaging            Apache; BSD
✔     idna                 BSD
✔     requests             Apache-2.0
✔     urllib3              MIT
‼     certifi              MPL-2.0
✔     pytest               MIT
✔     charset-normalizer   MIT

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.0.1.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

legallint-1.0.1-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: legallint-1.0.1.tar.gz
  • Upload date:
  • Size: 16.4 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.0.1.tar.gz
Algorithm Hash digest
SHA256 cf5eb2973caf6e926706b816b78c2f9bbc60590671faa52d016c0beaa1a5ba21
MD5 9d955404e90f1dd27f0416520f123d81
BLAKE2b-256 d675938c4d725f15378bab73aa5666f9275823b60f31fc7125955eeab4ef7d7e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: legallint-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 19.5 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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 539b9d82be6c91309588fc9525403272b0e36abc16cb69cefb0b67c78a4c3750
MD5 36fe79ae80b87c52a17c4c0ba83e1709
BLAKE2b-256 a11e03360346c5b48c356f1229d8ec9239ec4873c7f14d273d8bd85a47c17070

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