diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d401c4b4..359cb920 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ default_install_hook_types: [commit-msg, pre-commit] default_stages: [commit, merge-commit] repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-added-large-files - id: check-ast @@ -26,11 +26,11 @@ repos: - id: fix-byte-order-marker - id: trailing-whitespace - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.9.1 + rev: 24.2.0 hooks: - id: black - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/PyCQA/docformatter @@ -47,14 +47,14 @@ repos: additional_dependencies: - pydocstyle[toml] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.5.1 + rev: v1.8.0 hooks: - id: mypy additional_dependencies: - types-requests - types-PyYAML - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: v1.5.1 + rev: v1.5.5 hooks: - id: insert-license name: Insert license headers (shell-style comments) @@ -97,10 +97,10 @@ repos: - --comment-style - "..| |" - repo: https://github.com/fsfe/reuse-tool - rev: v2.1.0 + rev: v3.0.1 hooks: - id: reuse - repo: https://github.com/qoomon/git-conventional-commits - rev: v2.6.5 + rev: v2.6.7 hooks: - id: conventional-commits diff --git a/capella2polarion/converters/model_converter.py b/capella2polarion/converters/model_converter.py index a1548f90..6a1e3162 100644 --- a/capella2polarion/converters/model_converter.py +++ b/capella2polarion/converters/model_converter.py @@ -54,9 +54,9 @@ def read_model( if type_config := config.get_type_config( layer, c_type, **attributes ): - self.converter_session[ - obj.uuid - ] = data_session.ConverterData(layer, type_config, obj) + self.converter_session[obj.uuid] = ( + data_session.ConverterData(layer, type_config, obj) + ) else: missing_types.add((layer, c_type, attributes)) diff --git a/tests/test_elements.py b/tests/test_elements.py index 57a18b02..11455838 100644 --- a/tests/test_elements.py +++ b/tests/test_elements.py @@ -479,15 +479,15 @@ def test_create_links_custom_exchanges_resolver( base_object.pw.polarion_data_repo.update_work_items( [work_item_obj_1, work_item_obj_2] ) - base_object.mc.converter_session[ - function_uuid - ] = data_session.ConverterData( - "fa", - converter_config.CapellaTypeConfig( - type(funtion_obj).__name__, links=["input_exchanges"] - ), - funtion_obj, - work_item_obj_1, + base_object.mc.converter_session[function_uuid] = ( + data_session.ConverterData( + "fa", + converter_config.CapellaTypeConfig( + type(funtion_obj).__name__, links=["input_exchanges"] + ), + funtion_obj, + work_item_obj_1, + ) ) base_object.mc.converter_session[uuid] = data_session.ConverterData( "fa", @@ -563,13 +563,13 @@ def test_create_links_from_ElementList(base_object: BaseObjectContainer): ] base_object.pw.polarion_data_repo.update_work_items(work_items) for work_item in work_items: - base_object.mc.converter_session[ - work_item.uuid_capella - ] = data_session.ConverterData( - "", - base_object.mc.converter_session["uuid1"].type_config, - fake_objects[work_item.uuid_capella], - work_item, + base_object.mc.converter_session[work_item.uuid_capella] = ( + data_session.ConverterData( + "", + base_object.mc.converter_session["uuid1"].type_config, + fake_objects[work_item.uuid_capella], + work_item, + ) ) expected_link = polarion_api.WorkItemLink( @@ -659,15 +659,15 @@ def test_update_work_items( base_object.pw.load_polarion_work_item_map() - base_object.mc.converter_session[ - "uuid1" - ].work_item = data_models.CapellaWorkItem( - id="Obj-1", - uuid_capella="uuid1", - title="Fake 1", - type="type", - description_type="text/html", - description=markupsafe.Markup(""), + base_object.mc.converter_session["uuid1"].work_item = ( + data_models.CapellaWorkItem( + id="Obj-1", + uuid_capella="uuid1", + title="Fake 1", + type="type", + description_type="text/html", + description=markupsafe.Markup(""), + ) ) del base_object.mc.converter_session["uuid2"] @@ -726,17 +726,17 @@ def test_update_deleted_work_item( base_object.pw.load_polarion_work_item_map() - base_object.mc.converter_session[ - "uuid1" - ].work_item = data_models.CapellaWorkItem( - id="Obj-1", - type="type", - uuid_capella="uuid1", - status="open", - title="Something", - description_type="text/html", - description=markupsafe.Markup("Test"), - checksum="123", + base_object.mc.converter_session["uuid1"].work_item = ( + data_models.CapellaWorkItem( + id="Obj-1", + type="type", + uuid_capella="uuid1", + status="open", + title="Something", + description_type="text/html", + description=markupsafe.Markup("Test"), + checksum="123", + ) ) del base_object.mc.converter_session["uuid2"] @@ -774,13 +774,13 @@ def test_update_work_items_filters_work_items_with_same_checksum( ) ] ) - base_object.mc.converter_session[ - "uuid1" - ].work_item = data_models.CapellaWorkItem( - id="Obj-1", - uuid_capella="uuid1", - status="open", - type="fakeModelObject", + base_object.mc.converter_session["uuid1"].work_item = ( + data_models.CapellaWorkItem( + id="Obj-1", + uuid_capella="uuid1", + status="open", + type="fakeModelObject", + ) ) del base_object.mc.converter_session["uuid2"] @@ -806,13 +806,13 @@ def test_update_work_items_same_checksum_force( ) ] ) - base_object.mc.converter_session[ - "uuid1" - ].work_item = data_models.CapellaWorkItem( - id="Obj-1", - uuid_capella="uuid1", - status="open", - type="fakeModelObject", + base_object.mc.converter_session["uuid1"].work_item = ( + data_models.CapellaWorkItem( + id="Obj-1", + uuid_capella="uuid1", + status="open", + type="fakeModelObject", + ) ) del base_object.mc.converter_session["uuid2"] @@ -849,21 +849,21 @@ def test_update_links(base_object: BaseObjectContainer): ) ] ) - base_object.mc.converter_session[ - "uuid1" - ].work_item = data_models.CapellaWorkItem( - id="Obj-1", - uuid_capella="uuid1", - status="open", - type="fakeModelObject", + base_object.mc.converter_session["uuid1"].work_item = ( + data_models.CapellaWorkItem( + id="Obj-1", + uuid_capella="uuid1", + status="open", + type="fakeModelObject", + ) ) - base_object.mc.converter_session[ - "uuid2" - ].work_item = data_models.CapellaWorkItem( - id="Obj-2", - uuid_capella="uuid2", - status="open", - type="fakeModelObject", + base_object.mc.converter_session["uuid2"].work_item = ( + data_models.CapellaWorkItem( + id="Obj-2", + uuid_capella="uuid2", + status="open", + type="fakeModelObject", + ) ) assert base_object.pw.client is not None