Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code climate: set mypy to --strict mode, ignore appeared checks for now #166

Merged
merged 1 commit into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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