From 1db81ec208372d6374c8b14fa62ccf9273f06af6 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sat, 18 Mar 2023 14:53:55 -0700 Subject: [PATCH] pylint: remove bad-option-value from the configuration Signed-off-by: David Aguilar --- .pylintrc | 2 -- cola/cmd.py | 2 -- cola/cmds.py | 8 -------- cola/compat.py | 3 --- cola/fsmonitor.py | 1 - cola/git.py | 1 - cola/gitcfg.py | 2 +- cola/models/browse.py | 1 - cola/polib.py | 10 ++-------- cola/qtutils.py | 1 - cola/widgets/completion.py | 4 +--- cola/widgets/diff.py | 2 +- cola/widgets/highlighter.py | 2 +- cola/widgets/standard.py | 1 - cola/widgets/status.py | 1 - cola/widgets/text.py | 7 +++---- 16 files changed, 9 insertions(+), 39 deletions(-) diff --git a/.pylintrc b/.pylintrc index 2d012227..d9897b2c 100644 --- a/.pylintrc +++ b/.pylintrc @@ -55,8 +55,6 @@ confidence= # --disable=W" disable= assignment-from-none, - bad-continuation, - bad-option-value, consider-using-with, consider-using-f-string, duplicate-code, diff --git a/cola/cmd.py b/cola/cmd.py index bf318b98..528e8c8d 100644 --- a/cola/cmd.py +++ b/cola/cmd.py @@ -17,12 +17,10 @@ class Command(object): """Can this be undone?""" return cls.UNDOABLE - # pylint: disable=no-self-use def do(self): """Execute the command""" return - # pylint: disable=no-self-use def undo(self): """Undo the command""" return diff --git a/cola/cmds.py b/cola/cmds.py index 4e79f35d..cf2cd1fe 100644 --- a/cola/cmds.py +++ b/cola/cmds.py @@ -79,32 +79,26 @@ class EditModel(ContextCommand): class ConfirmAction(ContextCommand): """Confirm an action before running it""" - # pylint: disable=no-self-use def ok_to_run(self): """Return True when the command is ok to run""" return True - # pylint: disable=no-self-use def confirm(self): """Prompt for confirmation""" return True - # pylint: disable=no-self-use def action(self): """Run the command and return (status, out, err)""" return (-1, '', '') - # pylint: disable=no-self-use def success(self): """Callback run on success""" return - # pylint: disable=no-self-use def command(self): """Command name, for error messages""" return 'git' - # pylint: disable=no-self-use def error_message(self): """Command error message""" return '' @@ -2248,7 +2242,6 @@ class RevertEditsCommand(ConfirmAction): def ok_to_run(self): return self.model.is_undoable() - # pylint: disable=no-self-use def checkout_from_head(self): return False @@ -2675,7 +2668,6 @@ class StageCarefully(Stage): super(StageCarefully, self).__init__(context, None) self.init_paths() - # pylint: disable=no-self-use def init_paths(self): """Initialize path data""" return diff --git a/cola/compat.py b/cola/compat.py index 3fa42212..09889938 100644 --- a/cola/compat.py +++ b/cola/compat.py @@ -43,11 +43,8 @@ if PY3: else: bchr = chr maxsize = 2**31 - # pylint: disable=unicode-builtin ustr = unicode # noqa - # pylint: disable=unichr-builtin uchr = unichr # noqa - # pylint: disable=long-builtin int_types = (int, long) # noqa # Qt's max 32-bit signed integer range (-2147483648 to 2147483647) diff --git a/cola/fsmonitor.py b/cola/fsmonitor.py index 9850eb85..dcc0bc51 100644 --- a/cola/fsmonitor.py +++ b/cola/fsmonitor.py @@ -94,7 +94,6 @@ class _BaseThread(QtCore.QThread): def _pending(self): return self._force_notify or self._file_paths or self._force_config - # pylint: disable=no-self-use def refresh(self): """Do any housekeeping necessary in response to repository changes.""" return diff --git a/cola/git.py b/cola/git.py index 9a32621a..34e2b7de 100644 --- a/cola/git.py +++ b/cola/git.py @@ -188,7 +188,6 @@ class Git(object): self._valid = {} #: Store the result of is_git_dir() for performance self.set_worktree(core.getcwd()) - # pylint: disable=no-self-use def is_git_repository(self, path): return is_git_repository(path) diff --git a/cola/gitcfg.py b/cola/gitcfg.py index 606a52ce..123fda7b 100644 --- a/cola/gitcfg.py +++ b/cola/gitcfg.py @@ -45,7 +45,7 @@ def _config_to_python(v): v = False else: try: - v = int(v) # pylint: disable=redefined-variable-type + v = int(v) except ValueError: pass return v diff --git a/cola/models/browse.py b/cola/models/browse.py index 26e65dd9..b3884e32 100644 --- a/cola/models/browse.py +++ b/cola/models/browse.py @@ -85,7 +85,6 @@ class GitRepoModel(QtGui.QStandardItemModel): ) return qtutils.mimedata_from_paths(self.context, paths) - # pylint: disable=no-self-use def mimeTypes(self): return qtutils.path_mimetypes() diff --git a/cola/polib.py b/cola/polib.py index f1321349..85469b98 100644 --- a/cola/polib.py +++ b/cola/polib.py @@ -809,7 +809,7 @@ class MOFile(_BaseFile): """ _BaseFile.save(self, fpath) - # pylint: disable=no-self-use,arguments-differ + # pylint: disable=arguments-differ def save(self, fpath=None): """ Saves the mofile to ``fpath``. @@ -821,35 +821,30 @@ class MOFile(_BaseFile): """ _BaseFile.save(self, fpath, 'to_binary') - # pylint: disable=no-self-use def percent_translated(self): """ Convenience method to keep the same interface with POFile instances. """ return 100 - # pylint: disable=no-self-use def translated_entries(self): """ Convenience method to keep the same interface with POFile instances. """ return self - # pylint: disable=no-self-use def untranslated_entries(self): """ Convenience method to keep the same interface with POFile instances. """ return [] - # pylint: disable=no-self-use def fuzzy_entries(self): """ Convenience method to keep the same interface with POFile instances. """ return [] - # pylint: disable=no-self-use def obsolete_entries(self): """ Convenience method to keep the same interface with POFile instances. @@ -957,7 +952,6 @@ class _BaseEntry(object): def __hash__(self): return hash(str(self)) - # pylint: disable=no-self-use def _str_field(self, fieldname, delflag, plural_index, field, wrapwidth=78): lines = field.splitlines(True) if len(lines) > 1: @@ -1120,7 +1114,7 @@ class POEntry(_BaseEntry): ret = u('\n').join(ret) return ret - # pylint: disable=cmp-method,too-many-return-statements + # pylint: disable=too-many-return-statements def __cmp__(self, other): """ Called by comparison operations if rich comparison is not defined. diff --git a/cola/qtutils.py b/cola/qtutils.py index b3464b43..7eb2a288 100644 --- a/cola/qtutils.py +++ b/cola/qtutils.py @@ -1024,7 +1024,6 @@ class Task(QtCore.QRunnable): self.channel.result.emit(self.result) self.channel.finished.emit(self) - # pylint: disable=no-self-use def task(self): return None diff --git a/cola/widgets/completion.py b/cola/widgets/completion.py index e8bf08b0..916c6c1f 100644 --- a/cola/widgets/completion.py +++ b/cola/widgets/completion.py @@ -426,7 +426,7 @@ class CompletionModel(QtGui.QStandardItemModel): if not self.update_thread.isRunning(): self.update_thread.start() - # pylint: disable=unused-argument,no-self-use + # pylint: disable=unused-argument def gather_matches(self, case_sensitive): return ((), (), set()) @@ -549,7 +549,6 @@ class GitCompletionModel(CompletionModel): ) return (refs, (), set()) - # pylint: disable=no-self-use def matches(self): return [] @@ -637,7 +636,6 @@ class GitPathCompletionModel(GitCompletionModel): def __init__(self, context, parent): GitCompletionModel.__init__(self, context, parent) - # pylint: disable=no-self-use def candidate_paths(self): return [] diff --git a/cola/widgets/diff.py b/cola/widgets/diff.py index b02b1348..4ea57b11 100644 --- a/cola/widgets/diff.py +++ b/cola/widgets/diff.py @@ -455,7 +455,7 @@ class DiffLineNumbers(TextDecorator): text, ) - block = block.next() # pylint: disable=next-method-called + block = block.next() class Viewer(QtWidgets.QFrame): diff --git a/cola/widgets/highlighter.py b/cola/widgets/highlighter.py index cdc7f47a..0c0d8df4 100644 --- a/cola/widgets/highlighter.py +++ b/cola/widgets/highlighter.py @@ -86,7 +86,7 @@ def highlight_document(edit, filename): if block_len == 0: block.layout().setAdditionalFormats(block_formats) doc.markContentsDirty(block.position(), block.length()) - block = block.next() # pylint: disable=next-method-called + block = block.next() block_pos = 0 block_len = block.length() block_formats = [] diff --git a/cola/widgets/standard.py b/cola/widgets/standard.py index 49d6587d..cf1ad1d7 100644 --- a/cola/widgets/standard.py +++ b/cola/widgets/standard.py @@ -528,7 +528,6 @@ class Dialog(WidgetMixin, QtWidgets.QDialog): self.dispose() return self.Base.reject(self) - # pylint: disable=no-self-use def dispose(self): """Extension method for model deregistration in sub-classes""" return diff --git a/cola/widgets/status.py b/cola/widgets/status.py index 0073cbe0..d8991a83 100644 --- a/cola/widgets/status.py +++ b/cola/widgets/status.py @@ -1251,7 +1251,6 @@ class StatusTreeWidget(QtWidgets.QTreeWidget): include_urls = not self._alt_drag return qtutils.mimedata_from_paths(context, paths, include_urls=include_urls) - # pylint: disable=no-self-use def mimeTypes(self): """Return the mimetypes that this widget generates""" return qtutils.path_mimetypes(include_urls=not self._alt_drag) diff --git a/cola/widgets/text.py b/cola/widgets/text.py index 9b5c511b..089b27f4 100644 --- a/cola/widgets/text.py +++ b/cola/widgets/text.py @@ -261,17 +261,16 @@ class BaseTextEditExtension(QtCore.QObject): # For extension by sub-classes - # pylint: disable=no-self-use def init(self): """Called during init for class-specific settings""" return - # pylint: disable=no-self-use,unused-argument + # pylint: disable=unused-argument def set_textwidth(self, width): """Set the text width""" return - # pylint: disable=no-self-use,unused-argument + # pylint: disable=unused-argument def set_linebreak(self, brk): """Enable word wrapping""" return @@ -1157,4 +1156,4 @@ class LineNumbers(TextDecorator): Qt.AlignRight | Qt.AlignVCenter, number, ) - block = block.next() # pylint: disable=next-method-called + block = block.next() -- 2.11.4.GIT