diff --git a/novelwriter/core/index.py b/novelwriter/core/index.py index b4bdaba5..1097294c 100644 --- a/novelwriter/core/index.py +++ b/novelwriter/core/index.py @@ -605,7 +605,7 @@ class Index: """Get all headings for a specific item.""" if tItem := self._itemIndex[tHandle]: yield from tItem.items() - return [] + return def novelStructure( self, rootHandle: str | None = None, activeOnly: bool = True diff --git a/novelwriter/gui/editordocument.py b/novelwriter/gui/editordocument.py index 79754656..e2753038 100644 --- a/novelwriter/gui/editordocument.py +++ b/novelwriter/gui/editordocument.py @@ -137,7 +137,7 @@ class GuiTextDocument(QTextDocument): if count < maxCount and block.isValid() and block.userState() & cType > 0: count += 1 yield block - return None + return ## # Public Slots diff --git a/pyproject.toml b/pyproject.toml index d22d9bd3..76bff95a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,6 +59,7 @@ forced_separate = ["tests.*"] line-length = 99 [tool.ruff.lint] +preview = true select = [ "A", # flake8-builtins (A) "B", # flake8-bugbear (B) @@ -67,7 +68,6 @@ select = [ "W", # pycodestyle (W) "UP", # pyupgrade (UP) "ANN", # flake8-annotations (ANN) - "PLC", # Pylint Convention (PLC) "PLE", # Pylint Error (PLE) "FA", # flake8-future-annotations (FA) ] @@ -76,6 +76,7 @@ ignore = [ "E226", # missing-whitespace-around-arithmetic-operator "E228", # missing-whitespace-around-modulo-operator "E241", # multiple-spaces-after-comma + "E272", # multiple-spaces-before-keyword "ANN401", # any-type "UP015", # redundant-open-modes "UP030", # format-literals @@ -92,11 +93,6 @@ include = ["novelwriter"] exclude = ["**/__pycache__"] reportIncompatibleMethodOverride = false -reportGeneralTypeIssues = "information" -reportOptionalMemberAccess = "information" -reportOptionalOperand = "information" -reportOptionalSubscript = "information" -reportUnboundVariable = "error" pythonVersion = "3.10"