summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2023-07-23 13:53:31 +0200
committerFlorian Bruhin <me@the-compiler.org>2023-07-23 13:53:31 +0200
commit09fd975af70ca27a53980dc433332a377b1c9208 (patch)
tree938c85a95e0e844e8f0107e86b7b4307559cc6ed
parent9d749bd7d2ff0700430a09c91f7ac89ff6482451 (diff)
downloadqutebrowser-09fd975af70ca27a53980dc433332a377b1c9208.tar.gz
qutebrowser-09fd975af70ca27a53980dc433332a377b1c9208.zip
reuse: Add linting for old license comments
-rw-r--r--.pylintrc2
-rw-r--r--scripts/dev/misc_checks.py9
-rw-r--r--scripts/dev/run_pylint_on_tests.py2
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=(<?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()