Skip to content

Commit

Permalink
ci: fix mypy and pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
micha91 committed Oct 16, 2024
1 parent 07bdc25 commit b9e32a1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ repos:
- capellambse==0.6.6
- click
- jinja2
- polarion-rest-api-client==1.1.3
- polarion-rest-api-client==1.2.0
- pydantic
- types-requests
- types-PyYAML
Expand Down
2 changes: 0 additions & 2 deletions capella2polarion/connectors/polarion_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def __init__(
delete_status=(
"deleted" if self.polarion_params.delete_work_items else None
),
add_work_item_checksum=True,
)
self._additional_clients: dict[str, polarion_api.ProjectClient] = {}
self.check_client()
Expand All @@ -104,7 +103,6 @@ def _get_client(
delete_status=(
"deleted" if self.polarion_params.delete_work_items else None
),
add_work_item_checksum=True,
)
if not client.exists():
raise KeyError(f"Miss Polarion project with id {project_id}")
Expand Down
4 changes: 2 additions & 2 deletions capella2polarion/data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import dataclasses
import hashlib
import json
import typing as t

import polarion_rest_api_client as polarion_api

Expand All @@ -24,7 +23,9 @@ class CapellaWorkItem(polarion_api.WorkItem):

def clear_attributes(self):
"""Clear all additional attributes except the checksum."""
# pylint: disable=attribute-defined-outside-init
self.additional_attributes = {"checksum": self.checksum}
# pylint: enable=attribute-defined-outside-init

def calculate_checksum(self) -> str:
"""Calculate and return a checksum for this WorkItem.
Expand Down Expand Up @@ -57,7 +58,6 @@ def calculate_checksum(self) -> str:
data = dict(sorted(data.items()))

converted = json.dumps(data).encode("utf8")
# pylint: disable=attribute-defined-outside-init
self.checksum = json.dumps(
{"__C2P__WORK_ITEM": hashlib.sha256(converted).hexdigest()}
| dict(sorted(attachment_checksums.items()))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -1648,8 +1648,8 @@ def test_diagram(model: capellambse.MelodyModel):
"uuid_capella": TEST_ACTOR_UUID,
"description": polarion_api.HtmlContent(
markupsafe.Markup(
"<p>Principal of Hogwarts, wearer of the elder wand "
"and greatest mage of all time.</p>\n"
"<p>Principal of Hogwarts, wearer of the elder"
" wand and greatest mage of all time.</p>\n"
)
),
},
Expand Down

0 comments on commit b9e32a1

Please sign in to comment.