From 583448034899d1853021f1b9664ba1bf22781cc9 Mon Sep 17 00:00:00 2001 From: Florian Maurer Date: Tue, 7 Nov 2023 17:46:32 +0100 Subject: [PATCH] add reuse lint to CI and pre-commit hook (#244) This adds linting reuse compliance to the pre-commit hook and the CI. So that we stay reuse compliant when adding new files --- .github/workflows/lint-pytest.yaml | 4 ++++ .pre-commit-config.yaml | 6 ++++++ assume/common/exceptions.py | 2 ++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/lint-pytest.yaml b/.github/workflows/lint-pytest.yaml index f6deb122..86af5304 100644 --- a/.github/workflows/lint-pytest.yaml +++ b/.github/workflows/lint-pytest.yaml @@ -30,6 +30,10 @@ jobs: python-version: ${{ matrix.python-version }} cache: 'pip' cache-dependency-path: '**/pyproject.toml' + - name: Check reuse compliance + run: | + pip install reuse + reuse lint - name: Install dependencies run: | sudo apt-get update && sudo apt-get install --no-install-recommends -y coinor-cbc gcc g++ libglpk-dev glpk-utils && sudo rm -rf /var/lib/apt/lists/* diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 42032fa6..4d68d38e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,6 +3,12 @@ # SPDX-License-Identifier: AGPL-3.0-or-later repos: + - repo: https://github.com/fsfe/reuse-tool + rev: v2.1.0 + hooks: + - id: reuse + args: ["annotate", "--license", "AGPL-3.0-or-later", "--recursive", "--copyright", "ASSUME Developers", "--exclude-year", "--skip-unrecognised", "."] + - repo: https://github.com/pycqa/isort rev: 5.12.0 hooks: diff --git a/assume/common/exceptions.py b/assume/common/exceptions.py index f29eacf5..08c12f05 100644 --- a/assume/common/exceptions.py +++ b/assume/common/exceptions.py @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: AGPL-3.0-or-later +# Assume Exceptions + class AssumeException(Exception): pass