From 09fd975af70ca27a53980dc433332a377b1c9208 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 23 Jul 2023 13:53:31 +0200 Subject: reuse: Add linting for old license comments --- .pylintrc | 2 +- scripts/dev/misc_checks.py | 9 +++++++++ scripts/dev/run_pylint_on_tests.py | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index 341bbe8cb..a02732c2d 100644 --- a/.pylintrc +++ b/.pylintrc @@ -76,7 +76,7 @@ class-const-naming-style = snake_case [FORMAT] # FIXME:v4 (lint) down to 88 again once we use black max-line-length=190 -ignore-long-lines=( Optional[bool]: re.compile(r'pathlib\.Path\(tmpdir\)'), "use tmp_path instead", ), + ( + re.compile(r' Copyright 2'), + "use 'SPDX-FileCopyrightText: ...' without year instead", + ), + ( + re.compile(r'qutebrowser is free software: you can redistribute'), + "use 'SPDX-License-Identifier: GPL-3.0-or-later' instead", + ), ] # Files which should be ignored, e.g. because they come from another @@ -276,6 +284,7 @@ def check_spelling(args: argparse.Namespace) -> Optional[bool]: pathlib.Path('scripts', 'dev', 'enums.txt'), pathlib.Path('qutebrowser', '3rdparty', 'pdfjs'), pathlib.Path('qutebrowser', 'qt', '_core_pyqtproperty.py'), + pathlib.Path('qutebrowser', 'javascript', 'caret.js'), hint_data / 'ace' / 'ace.js', hint_data / 'bootstrap' / 'bootstrap.css', ] diff --git a/scripts/dev/run_pylint_on_tests.py b/scripts/dev/run_pylint_on_tests.py index d9d85b647..580ef988f 100644 --- a/scripts/dev/run_pylint_on_tests.py +++ b/scripts/dev/run_pylint_on_tests.py @@ -63,7 +63,7 @@ def main(): args = [ '--disable={}'.format(','.join(disabled)), '--ignored-modules=helpers,pytest,PyQt5', - r'--ignore-long-lines=(