summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Albrecht <palbrecht@mailbox.org>2023-06-30 10:50:22 +0200
committerPhilipp Albrecht <palbrecht@mailbox.org>2023-06-30 10:59:06 +0200
commit08ea751fe1cf1a2da9cd1fc97453bb425517a4f3 (patch)
tree41ded49926547764e92c5af61fa38e63f2e3b6ae
parent772c39cea29848459d21f563228ca1d360f69d4b (diff)
downloadqutebrowser-08ea751fe1cf1a2da9cd1fc97453bb425517a4f3.tar.gz
qutebrowser-08ea751fe1cf1a2da9cd1fc97453bb425517a4f3.zip
Remove modeline pylint checker
We're deprecating vim modelines in favor of `.editorconfig`.
-rw-r--r--.pylintrc1
-rw-r--r--scripts/dev/pylint_checkers/qute_pylint/modeline.py63
-rwxr-xr-xscripts/dev/run_vulture.py2
3 files changed, 0 insertions, 66 deletions
diff --git a/.pylintrc b/.pylintrc
index b5a391288..6692c0fb2 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -4,7 +4,6 @@
ignore=resources.py
extension-pkg-whitelist=PyQt5,sip
load-plugins=qute_pylint.config,
- qute_pylint.modeline,
pylint.extensions.docstyle,
pylint.extensions.emptystring,
pylint.extensions.overlapping_exceptions,
diff --git a/scripts/dev/pylint_checkers/qute_pylint/modeline.py b/scripts/dev/pylint_checkers/qute_pylint/modeline.py
deleted file mode 100644
index 1df2c375e..000000000
--- a/scripts/dev/pylint_checkers/qute_pylint/modeline.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright 2014-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
-# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
-
-# This file is part of qutebrowser.
-#
-# qutebrowser is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# qutebrowser is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with qutebrowser. If not, see <https://www.gnu.org/licenses/>.
-
-"""Checker for vim modelines in files."""
-
-import os.path
-import contextlib
-
-from pylint import interfaces, checkers
-
-
-class ModelineChecker(checkers.BaseChecker):
-
- """Check for vim modelines in files."""
-
- __implements__ = interfaces.IRawChecker
-
- name = 'modeline'
- msgs = {'W9102': ('Does not have vim modeline', 'modeline-missing', None),
- 'W9103': ('Modeline is invalid', 'invalid-modeline', None),
- 'W9104': ('Modeline position is wrong', 'modeline-position', None)}
- options = ()
- priority = -1
-
- def process_module(self, node):
- """Process the module."""
- if os.path.basename(os.path.splitext(node.file)[0]) == '__init__':
- return
- max_lineno = 1
- with contextlib.closing(node.stream()) as stream:
- for (lineno, line) in enumerate(stream):
- if lineno == 1 and line.startswith(b'#!'):
- max_lineno += 1
- continue
- elif line.startswith(b'# vim:'):
- if lineno > max_lineno:
- self.add_message('modeline-position', line=lineno)
- if (line.rstrip() != b'# vim: ft=python '
- b'fileencoding=utf-8 sts=4 sw=4 et:'):
- self.add_message('invalid-modeline', line=lineno)
- break
- else:
- self.add_message('modeline-missing', line=1)
-
-
-def register(linter):
- """Register the checker."""
- linter.register_checker(ModelineChecker(linter))
diff --git a/scripts/dev/run_vulture.py b/scripts/dev/run_vulture.py
index b4b46fdb3..0bbfb3bfa 100755
--- a/scripts/dev/run_vulture.py
+++ b/scripts/dev/run_vulture.py
@@ -100,8 +100,6 @@ def whitelist_generator(): # noqa: C901
for attr in ['msgs', 'priority', 'visit_attribute']:
yield 'scripts.dev.pylint_checkers.config.' + attr
- for attr in ['visit_call', 'process_module']:
- yield 'scripts.dev.pylint_checkers.modeline.' + attr
for name, _member in inspect.getmembers(configtypes, inspect.isclass):
yield 'qutebrowser.config.configtypes.' + name