Skip to content

Commit

Permalink
Merge pull request #166 from strictdoc-project/stanislaw/fix_xmlschem…
Browse files Browse the repository at this point in the history
…a_setup

Code climate: set mypy to --strict mode, ignore appeared checks for now
  • Loading branch information
stanislaw authored Apr 27, 2024
2 parents 3b1c923 + 0e3c88b commit 11d4afa
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
8 changes: 6 additions & 2 deletions reqif/helpers/lxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,17 @@ def lxml_convert_to_reqif_ns_xhtml_string(string, reqif_xhtml=True) -> str:
def lxml_convert_from_reqif_ns_xhtml_string(lxml_node) -> str:
lxml_node_deep_copy = deepcopy(lxml_node)
lxml_strip_namespace_from_xml(lxml_node_deep_copy, full=True)
return tostring(lxml_node_deep_copy, encoding=str, pretty_print=True).rstrip()
result: str = tostring(
lxml_node_deep_copy, encoding=str, pretty_print=True
).rstrip()
return result


def lxml_convert_children_from_reqif_ns_xhtml_string(lxml_node) -> str:
lxml_node_deep_copy = deepcopy(lxml_node)
lxml_strip_namespace_from_xml(lxml_node_deep_copy, full=True)
return lxml_stringify_children(lxml_node_deep_copy)
result: str = lxml_stringify_children(lxml_node_deep_copy)
return result


def lxml_is_self_closed_tag(xml):
Expand Down
2 changes: 1 addition & 1 deletion reqif/models/reqif_spec_object_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__( # pylint: disable=too-many-arguments
description: Optional[str] = None,
last_change: Optional[str] = None,
long_name: Optional[str] = None,
editable: Optional[bool] = None,
editable: Optional[str] = None,
default_value_definition_ref: Optional[str] = None,
default_value: Union[None, DefaultValueEmptySelfClosedTag, str] = None,
multi_valued: Optional[bool] = None,
Expand Down
2 changes: 1 addition & 1 deletion reqif/reqif_bundle.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import collections
from typing import Deque, Dict, Iterator, List, Optional, Any
from typing import Any, Deque, Dict, Iterator, List, Optional

from reqif.helpers.debug import auto_described
from reqif.models.error_handling import ReqIFSchemaError
Expand Down
7 changes: 6 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,13 @@ def lint_mypy(context):
mypy reqif/
--show-error-codes
--disable-error-code=import
--disable-error-code=arg-type
--disable-error-code=no-untyped-call
""", # --strict
--disable-error-code=no-untyped-def
--disable-error-code=type-arg
--disable-error-code=union-attr
--strict
""",
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any, Dict, List, Optional
from typing import Dict, List, Optional

from dataclasses_json import dataclass_json

Expand All @@ -15,7 +15,6 @@
ReqIFDataTypeDefinitionXHTML,
)
from reqif.models.reqif_spec_object import ReqIFSpecObject
from reqif.models.reqif_specification import ReqIFSpecification
from reqif.parser import ReqIFParser, ReqIFZParser
from reqif.reqif_bundle import ReqIFBundle, ReqIFZBundle

Expand Down

0 comments on commit 11d4afa

Please sign in to comment.