diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 7c5703e..54253a2 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -114,3 +114,11 @@ repos:
hooks:
- id: commitlint
stages: [commit-msg]
+ - repo: https://github.com/pre-commit/mirrors-prettier
+ rev: v3.1.0
+ hooks:
+ - id: prettier
+ types_or: [ts, css, html, markdown]
+ additional_dependencies:
+ - 'prettier@^3.2.5'
+ - 'prettier-plugin-tailwindcss@^0.5.14'
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c98c895..b5dd31f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -76,8 +76,7 @@ The key differences are:
- **Docstrings**: The [Numpy style guide] applies here.
- [numpy style guide]:
- https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard
+ [numpy style guide]: https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard
When writing docstrings for functions, use the imperative style, as per
[PEP-257]). For example, write "Do X and Y" instead of "Does X and Y".
@@ -124,7 +123,6 @@ The key differences are:
typing related classes like `t.TypedDict`.
-
Use the new syntax and classes for typing introduced with Python 3.10.
- Instead of `t.Tuple`, `t.List` etc. use the builtin classes `tuple`, `list`
@@ -142,8 +140,7 @@ The key differences are:
If you have set up black correctly, you don't need to worry about this though
:)
- [black code style]:
- https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html
+ [black code style]: https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html
- When working with `dict`s, consider using `t.TypedDict` instead of a more
generic `dict[str, float|int|str]`-like annotation where possible, as the
diff --git a/Dockerfile b/Dockerfile
index 1e8b0a8..5ba7f75 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -43,4 +43,4 @@ RUN chmod +x /entrypoint.sh
ENV MODEL_ENTRYPOINT=/model
RUN chmod -R 777 ./frontend/dist/
-ENTRYPOINT ["/entrypoint.sh"]
\ No newline at end of file
+ENTRYPOINT ["/entrypoint.sh"]
diff --git a/README.md b/README.md
index 5485cfa..2cd5ac5 100644
--- a/README.md
+++ b/README.md
@@ -16,8 +16,8 @@ We see a larger non-MBSE crowd struggling with the things hidden in the model. W
**Use cases**:
-- Provide insights into / "spell-out" the model for non-MBSE stakeholders via document-a-like dynamic views that describe model elements in a human-readable form.
-- Provide meaningful default views (that can be further customized) for the key elements to kickstart the model exploration.
+- Provide insights into / "spell-out" the model for non-MBSE stakeholders via document-a-like dynamic views that describe model elements in a human-readable form.
+- Provide meaningful default views (that can be further customized) for the key elements to kickstart the model exploration.
There are a few more use cases but we will reveal them a bit later.
diff --git a/capella_model_explorer/backend/explorer.py b/capella_model_explorer/backend/explorer.py
index a248726..bed0266 100644
--- a/capella_model_explorer/backend/explorer.py
+++ b/capella_model_explorer/backend/explorer.py
@@ -181,14 +181,23 @@ def read_template(template_name: str):
filters=filters,
)
base["objects"] = [
- {"idx": obj.uuid,
- "name": str(
- obj.name if obj.name else (
- obj.long_name if hasattr(obj, "long_name") else "undefined")
- )} for obj in objects
+ {
+ "idx": obj.uuid,
+ "name": str(
+ obj.name
+ if obj.name
+ else (
+ obj.long_name
+ if hasattr(obj, "long_name")
+ else "undefined"
+ )
+ ),
+ }
+ for obj in objects
]
except Exception as e:
import traceback
+
LOGGER.exception(
"Error finding objects for template %s", template_name
)
diff --git a/entrypoint.sh b/entrypoint.sh
index 29c0dbb..3ea167d 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -7,4 +7,4 @@ sed -i "s|__ROUTE_PREFIX__|${ROUTE_PREFIX}|g" ./frontend/dist/static/env.js
sed -i "s|href=\"/|href=\"${ROUTE_PREFIX}/|g" ./frontend/dist/index.html
sed -i "s|src=\"/|src=\"${ROUTE_PREFIX}/|g" ./frontend/dist/index.html
-exec python -m capella_model_explorer.backend ${MODEL_ENTRYPOINT} /views
\ No newline at end of file
+exec python -m capella_model_explorer.backend ${MODEL_ENTRYPOINT} /views
diff --git a/frontend/index.html b/frontend/index.html
index aa9c08b..cbe16b5 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -3,20 +3,17 @@
~ SPDX-License-Identifier: Apache-2.0
-->
-
+
-