From 3233dbcc8f036ebe83ae268813006f1476218d7c Mon Sep 17 00:00:00 2001 From: Mike Gerber Date: Mon, 22 Jul 2024 16:54:33 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=94=20pre-commit:=20Add=20license=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 10 ++++++++-- pyproject.toml | 31 +++++++++++++++++++++++++++++++ requirements-dev.txt | 2 ++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b6f88ef..4baed11 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.3 + rev: v0.5.4 hooks: - args: - --fix @@ -24,7 +24,7 @@ repos: id: ruff - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.1 + rev: v1.11.0 hooks: - additional_dependencies: - types-setuptools @@ -39,3 +39,9 @@ repos: rev: v0.3.3post1 hooks: - id: pre-commit-update + +- repo: https://github.com/dhatim/python-license-check + rev: 0.9.2 + hooks: + - id: liccheck + language: system diff --git a/pyproject.toml b/pyproject.toml index c2263e0..62bac78 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,3 +77,34 @@ disallow_untyped_calls = false [tool.ruff.lint] select = ["E", "F", "I"] + + +[tool.liccheck] +authorized_licenses = [ + "bsd", + "new bsd", + "bsd license", + "new bsd license", + "simplified bsd", + "apache", + "apache 2.0", + "apache software license", + "apache software", + "apache license 2.0", + "gnu lgpl", + "lgpl with exceptions or zpl", + "GNU Library or Lesser General Public License (LGPL)", + "GNU Lesser General Public License v3 (LGPLv3)", + "GNU Lesser General Public License v2 or later (LGPLv2+)", + "mit", + "mit license", + "python software foundation", + "Historical Permission Notice and Disclaimer (HPND)", + "public domain", + 'The Unlicense (Unlicense)', + "isc", + 'Mozilla Public License 2.0 (MPL 2.0)', +] +unauthorized_licenses = [ + "gpl v3", +] diff --git a/requirements-dev.txt b/requirements-dev.txt index 16ae880..f9f748a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -10,3 +10,5 @@ mypy types-lxml types-setuptools pytest-mypy + +liccheck