Skip to content

Commit 11d4afa

Browse files
authored
Merge pull request #166 from strictdoc-project/stanislaw/fix_xmlschema_setup
Code climate: set mypy to --strict mode, ignore appeared checks for now
2 parents 3b1c923 + 0e3c88b commit 11d4afa

5 files changed

Lines changed: 15 additions & 7 deletions

File tree

reqif/helpers/lxml.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,17 @@ def lxml_convert_to_reqif_ns_xhtml_string(string, reqif_xhtml=True) -> str:
183183
def lxml_convert_from_reqif_ns_xhtml_string(lxml_node) -> str:
184184
lxml_node_deep_copy = deepcopy(lxml_node)
185185
lxml_strip_namespace_from_xml(lxml_node_deep_copy, full=True)
186-
return tostring(lxml_node_deep_copy, encoding=str, pretty_print=True).rstrip()
186+
result: str = tostring(
187+
lxml_node_deep_copy, encoding=str, pretty_print=True
188+
).rstrip()
189+
return result
187190

188191

189192
def lxml_convert_children_from_reqif_ns_xhtml_string(lxml_node) -> str:
190193
lxml_node_deep_copy = deepcopy(lxml_node)
191194
lxml_strip_namespace_from_xml(lxml_node_deep_copy, full=True)
192-
return lxml_stringify_children(lxml_node_deep_copy)
195+
result: str = lxml_stringify_children(lxml_node_deep_copy)
196+
return result
193197

194198

195199
def lxml_is_self_closed_tag(xml):

reqif/models/reqif_spec_object_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def __init__( # pylint: disable=too-many-arguments
1919
description: Optional[str] = None,
2020
last_change: Optional[str] = None,
2121
long_name: Optional[str] = None,
22-
editable: Optional[bool] = None,
22+
editable: Optional[str] = None,
2323
default_value_definition_ref: Optional[str] = None,
2424
default_value: Union[None, DefaultValueEmptySelfClosedTag, str] = None,
2525
multi_valued: Optional[bool] = None,

reqif/reqif_bundle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import collections
2-
from typing import Deque, Dict, Iterator, List, Optional, Any
2+
from typing import Any, Deque, Dict, Iterator, List, Optional
33

44
from reqif.helpers.debug import auto_described
55
from reqif.models.error_handling import ReqIFSchemaError

tasks.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,13 @@ def lint_mypy(context):
147147
mypy reqif/
148148
--show-error-codes
149149
--disable-error-code=import
150+
--disable-error-code=arg-type
150151
--disable-error-code=no-untyped-call
151-
""", # --strict
152+
--disable-error-code=no-untyped-def
153+
--disable-error-code=type-arg
154+
--disable-error-code=union-attr
155+
--strict
156+
""",
152157
)
153158

154159

tests/integration/examples/04_convert_reqif_to_json/script.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44
from dataclasses import dataclass, field
55
from pathlib import Path
6-
from typing import Any, Dict, List, Optional
6+
from typing import Dict, List, Optional
77

88
from dataclasses_json import dataclass_json
99

@@ -15,7 +15,6 @@
1515
ReqIFDataTypeDefinitionXHTML,
1616
)
1717
from reqif.models.reqif_spec_object import ReqIFSpecObject
18-
from reqif.models.reqif_specification import ReqIFSpecification
1918
from reqif.parser import ReqIFParser, ReqIFZParser
2019
from reqif.reqif_bundle import ReqIFBundle, ReqIFZBundle
2120

0 commit comments

Comments
 (0)