diff --git a/ruff-strict-pep8.toml b/ruff-strict-pep8.toml index 2cd1a8c895..c69667c85e 100644 --- a/ruff-strict-pep8.toml +++ b/ruff-strict-pep8.toml @@ -29,7 +29,7 @@ ignore = [ ] select = [ 'E', 'F', 'I', 'W', 'INT', - 'Q', 'UP', 'YTT', 'TID', 'C4', 'COM818', 'PIE', + 'Q', 'UP', 'YTT', 'TID', 'C4', 'COM818', 'PIE', 'RET501', 'RUF', # nota: RUF can flag many unsolicited errors # preview rules 'RUF051', 'RUF056', # useless dict operation @@ -43,19 +43,24 @@ select = [ ] unfixable = ['PIE794'] + [lint.per-file-ignores] "recipes/*" = ['UP'] "manual/plugin_examples/*" = ['UP'] "setup/commands.py" = ['RUF022'] "src/calibre/*" = ['UP031'] +"src/calibre/customize/__init__.py" = ['RET501'] +"src/calibre/devices/interface.py" = ['RET501'] "src/calibre/devices/kobo/driver.py" = ['E116'] "src/calibre/ebooks/unihandecode/*codepoints.py" = ['E501'] "src/calibre/ebooks/metadata/sources/*" = ['UP'] +"src/calibre/ebooks/metadata/sources/base.py" = ['RET501'] "src/calibre/ebooks/pdf/reflow.py" = ['E114'] "src/calibre/gui2/store/stores/*" = ['UP'] "src/calibre/gui2/tts/manager.py" = ['UP037'] "src/calibre/utils/copy_files.py" = ['UP037'] "src/calibre/utils/smartypants.py" = ['RUF039', 'RUF055'] +"src/calibre/web/feeds/news.py" = ['RET501'] "src/qt/*.py" = ['I', 'E302'] "src/qt/*.pyi" = ['I'] diff --git a/src/calibre/ebooks/mobi/debug/mobi6.py b/src/calibre/ebooks/mobi/debug/mobi6.py index 50ecbddb44..8e0bfec64c 100644 --- a/src/calibre/ebooks/mobi/debug/mobi6.py +++ b/src/calibre/ebooks/mobi/debug/mobi6.py @@ -405,7 +405,7 @@ class IndexRecord: # {{{ def get_parent(self, index): if index.depth < 1: - return None + return parent_depth = index.depth - 1 for p in self.indices: if p.depth != parent_depth: diff --git a/src/calibre/gui2/library/delegates.py b/src/calibre/gui2/library/delegates.py index ed0cc8a723..324fa95572 100644 --- a/src/calibre/gui2/library/delegates.py +++ b/src/calibre/gui2/library/delegates.py @@ -610,7 +610,7 @@ class CcLongTextDelegate(StyledItemDelegate): # {{{ d = PlainTextDialog(parent, text, column_name=m.custom_columns[col]['name']) if d.exec() == QDialog.DialogCode.Accepted: m.setData(index, d.text, Qt.ItemDataRole.EditRole) - return None + return def setModelData(self, editor, model, index): model.setData(index, (editor.textbox.html), Qt.ItemDataRole.EditRole) @@ -665,7 +665,7 @@ class CcMarkdownDelegate(StyledItemDelegate): # {{{ base_url=base_url) if d.exec() == QDialog.DialogCode.Accepted: m.setData(index, (d.text), Qt.ItemDataRole.EditRole) - return None + return def setModelData(self, editor, model, index): model.setData(index, (editor.textbox.html), Qt.ItemDataRole.EditRole) @@ -816,7 +816,7 @@ class CcCommentsDelegate(StyledItemDelegate): # {{{ d = editor.exec() if d: m.setData(index, (editor.textbox.html), Qt.ItemDataRole.EditRole) - return None + return def setModelData(self, editor, model, index): model.setData(index, (editor.textbox.html), Qt.ItemDataRole.EditRole)