Repository navigation
Give slices whose names are not PlantUML ids an id of their own - #510
Merged
Merged
Conversation
The exporter uses a slice's name as its PlantUML id, but not every name is a valid one. PlantUML rejects "*", "+", "`", "<" and ">" in an id, [Inner] as App.Outer+Inner syntax error Container(App.Outer+Inner, Inner) error box instead of a container and slice names can contain them: SlicedBy names slices after type names such as "Outer+Inner" or "List`1", and a hand-built SliceIdentifier can be called anything. Only the flat, non-C4 form "[App.Outer+Inner]" happens to work, because it declares no id. No character a namespace cannot contain works in their place: of "-$#~:%@!^" only "$" is accepted, and only outside C4. So give such a slice an id of its own when the diagram is rendered: its name with every character other than letters, digits, "_" and "." replaced by "_", suffixed until it clashes with no other name in the diagram, and point the dependencies at it. The name stays the label, and a slice whose name is a valid id keeps it, so no existing diagram changes. The ids are assigned when rendering because the exporter matches slices and dependencies by name throughout. A "*" at the start of a label is read as a list bullet and dropped, so it is escaped as "~*". Signed-off-by: Alexander Linne <alexander.linne@tngtech.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #510 +/- ##
==========================================
+ Coverage 86.25% 86.32% +0.06%
==========================================
Files 260 260
Lines 12500 12563 +63
Branches 1218 1225 +7
==========================================
+ Hits 10782 10845 +63
Misses 1379 1379
Partials 339 339 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mak638
approved these changes
Oct 9, 2026
This was referenced Oct 26, 2026
Bump TngTech.ArchUnitNET and TngTech.ArchUnitNET.xUnit
albandvd/EMA-S9-DS-Gestion-des-dependances#11
Open
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The exporter uses a slice's name as its PlantUML id, but not every name is a valid one. PlantUML rejects
*,+,`,<and>in an id,[Inner] as App.Outer+Innersyntax errorContainer(App.Outer+Inner, Inner)error box instead of a containerand slice names can contain them:
SlicedBynames slices after type names such asOuter+InnerorList`1, and a hand-builtSliceIdentifiercan be called anything. Only the flat, non-C4 form[App.Outer+Inner]happens to work, because it declares no id.No character a namespace cannot contain works in their place: of
-$#~:%@!^only$is accepted, and only outside C4. So give such a slice an id of its own when the diagram is rendered: its name with every character other than letters, digits,_and.replaced by_, suffixed until it clashes with no other name in the diagram, and point the dependencies at it. The name stays the label, and a slice whose name is a valid id keeps it, so no existing diagram changes. The ids are assigned when rendering because the exporter matches slices and dependencies by name throughout.A
*at the start of a label is read as a list bullet and dropped, so it is escaped as~*.