diff --git a/CHANGELOG.md b/CHANGELOG.md index 14c8e08..1e5c5c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ - mermaid: change mapper signatures and defaults - tree.to_rdf() is now available for Tree (not only TypedTree). - New method `node.up()` allows method chaining when adding nodes. -- Passes more pyright 'basic' checks. +- Passes pyright 'typeCheckingMode = "standard"' ## 0.9.0 (2024-09-12) diff --git a/nutree/rdf.py b/nutree/rdf.py index 10406ea..f425d18 100644 --- a/nutree/rdf.py +++ b/nutree/rdf.py @@ -3,6 +3,7 @@ """ Functions and declarations to implement `rdflib `_. """ +# pragma: exclude-file-from-coverage # pyright: reportOptionalCall=false # pyright: reportInvalidTypeForm=false diff --git a/pyproject.toml b/pyproject.toml index db614b6..30c7e3f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,11 +34,8 @@ ignore = [ [tool.pyright] typeCheckingMode = "standard" -# typeCheckingMode = "off" reportMissingImports = "none" -# include = ["nutree"] include = ["nutree", "tests"] -# exclude = ["**/nutree/rdf.py"] # https://github.com/microsoft/pyright/blob/main/docs/configuration.md#sample-pyprojecttoml-file reportUnnecessaryTypeIgnoreComment = true @@ -69,7 +66,15 @@ exclude_lines = [ "if __name__ == .__main__.:", "if TYPE_CHECKING:", ] - +exclude_also = [ + # 1. Exclude an except clause of a specific form: + # "except ValueError:\\n\\s*assume\\(False\\)", + # 2. Comments to turn coverage on and off: + # "no cover: start(?s:.)*?no cover: stop", + # 3. A pragma comment that excludes an entire file: + # "\\A(?s:.*# pragma: exclude file.*)\\Z", + "\\A(?s:.*# pragma: exclude-file-from-coverage.*)\\Z", + ] [tool.coverage.html] directory = "build/coverage"