diff options
author | Florian Bruhin <me@the-compiler.org> | 2023-07-23 13:53:31 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2023-07-23 13:53:31 +0200 |
commit | 09fd975af70ca27a53980dc433332a377b1c9208 (patch) | |
tree | 938c85a95e0e844e8f0107e86b7b4307559cc6ed | |
parent | 9d749bd7d2ff0700430a09c91f7ac89ff6482451 (diff) | |
download | qutebrowser-09fd975af70ca27a53980dc433332a377b1c9208.tar.gz qutebrowser-09fd975af70ca27a53980dc433332a377b1c9208.zip |
reuse: Add linting for old license comments
-rw-r--r-- | .pylintrc | 2 | ||||
-rw-r--r-- | scripts/dev/misc_checks.py | 9 | ||||
-rw-r--r-- | scripts/dev/run_pylint_on_tests.py | 2 |
3 files changed, 11 insertions, 2 deletions
@@ -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=(<?https?://|file://|^# Copyright 201\d|link:) +ignore-long-lines=(<?https?://|file://|link:) expected-line-ending-format=LF [VARIABLES] diff --git a/scripts/dev/misc_checks.py b/scripts/dev/misc_checks.py index df3162058..7b6404cf6 100644 --- a/scripts/dev/misc_checks.py +++ b/scripts/dev/misc_checks.py @@ -266,6 +266,14 @@ def check_spelling(args: argparse.Namespace) -> 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=(<?https?://|^# Copyright 201\d)|^ *def [a-z]', + r'--ignore-long-lines=(<?https?://)|^ *def [a-z]', r'--method-rgx=[a-z_][A-Za-z0-9_]{1,100}$', ] + sys.argv[2:] + files env = os.environ.copy() |