Title: Slices don't differentiate between (*) and (**) making top-level cycle checks impossible · Issue #468 · TNG/ArchUnitNET · GitHub
Open Graph Title: Slices don't differentiate between (*) and (**) making top-level cycle checks impossible · Issue #468 · TNG/ArchUnitNET
X Title: Slices don't differentiate between (*) and (**) making top-level cycle checks impossible · Issue #468 · TNG/ArchUnitNET
Description: if I understand the original docs of ArchUnit correctly, there should be a difference between (*) and (**). (*) should target the package (**) should target the package and its sub packages See also https://www.archunit.org/userguide/htm...
Open Graph Description: if I understand the original docs of ArchUnit correctly, there should be a difference between (*) and (**). (*) should target the package (**) should target the package and its sub packages See als...
X Description: if I understand the original docs of ArchUnit correctly, there should be a difference between (*) and (**). (*) should target the package (**) should target the package and its sub packages See als...
Opengraph URL: https://github.com/TNG/ArchUnitNET/issues/468
X: @github
Domain: redirect.github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Slices don't differentiate between (*) and (**) making top-level cycle checks impossible","articleBody":"if I understand the original docs of ArchUnit correctly, there should be a difference between (*) and (**).\n\n- (*) should target the package\n- (**) should target the package and its sub packages\n\nSee also https://www.archunit.org/userguide/html/000_Index.html#_slices\n\nthis is however not how the dotnet port of ArchUnit behaves.\n\nIf I specify sth. like CycleDemo.(*) I'd expect it to only check cycles on the top-level\n\nso \n\n- Domain -\u003e Db -\u003e Domain should be detected\n- Domain.Beers -\u003e Domain.Wine -\u003e Domain.Beers should **not** be detected\n\nit will detect however both cycles effectively behaving like (**)\n\n```\n\"Slices matching \"CycleDemo.(*)\" should be free of cycles\" failed:\n\tCycle found:\nDb -\u003e Domain\n\tCycleDemo.Db.ViolatingRepository -\u003e CycleDemo.Domain.Service\nDomain -\u003e Db\n\tCycleDemo.Domain.Service -\u003e CycleDemo.Db.Repository\n\n\tCycle found:\nDomain.Beers -\u003e Domain.Wines\n\tCycleDemo.Domain.Beers.Beer -\u003e CycleDemo.Domain.Wines.Wine\nDomain.Wines -\u003e Domain.Beers\n\tCycleDemo.Domain.Wines.Wine -\u003e CycleDemo.Domain.Beers.Beer\n```\n\nI compared it with the behavior of the Java implementation and it works as documented.\n\n```\nArchitecture Violation [Priority: MEDIUM] - Rule 'slices matching 'demo.(*)' should be free of cycles' was violated (1 times):\nCycle detected: Slice db -\u003e \n Slice domain -\u003e \n Slice db\n 1. Dependencies of Slice db\n - Field \u003cdemo.db.ViolatingRepository.service\u003e has type \u003cdemo.domain.Service\u003e in (ViolatingRepository.java:0)\n - Constructor \u003cdemo.db.ViolatingRepository.\u003cinit\u003e()\u003e calls constructor \u003cdemo.domain.Service.\u003cinit\u003e()\u003e in (ViolatingRepository.java:6)\n 2. Dependencies of Slice domain\n - Field \u003cdemo.domain.Service.repository\u003e has type \u003cdemo.db.Repository\u003e in (Service.java:0)\n - Constructor \u003cdemo.domain.Service.\u003cinit\u003e()\u003e calls constructor \u003cdemo.db.Repository.\u003cinit\u003e()\u003e in (Service.java:6)\n```\n\nIf I look inside the `SliceRuleInitializer.cs` it confirms my suspicion. A single asterisk will be replaced with a double asterisk (line 81):\n\n```csharp\nvar countOfSingleAsterisk =\npattern.Split(new[] { \"(*)\" }, StringSplitOptions.None).Length - 1;\npattern = pattern.Remove(indexOfAsteriskInPattern) + \"(**).\";\n```\n\nAm I missing something?\n\nping me if I should upload my reproduction projects to GitHub!","author":{"url":"https://github.com/enolive","@type":"Person","name":"enolive"},"datePublished":"2026-06-17T14:31:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/468/ArchUnitNET/issues/468"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:62f2cd69-5a46-ef84-003d-30f374543342 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B51E:31038C:283C6C4:39F8098:6A4BF32B |
| html-safe-nonce | ef5ba2243e713cbae444922083ddc66170e7d0ef2a56aaaf9dbed7ec7fe2415b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNTFFOjMxMDM4QzoyODNDNkM0OjM5RjgwOTg6NkE0QkYzMkIiLCJ2aXNpdG9yX2lkIjoiNjM2MDMzMDgwMTcxNjY1NDg5MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 56a38333f38109fe6b698c41e6c6541a533bd0d58b1efa3b3fb39551b128fcef |
| hovercard-subject-tag | issue:4684227782 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TNG/ArchUnitNET/468/issue_layout |
| twitter:image | https://opengraph.githubassets.com/39d81dff1184b72573ed0b1225f4b0155475e0e14a8408ce3795d2a0528198e5/TNG/ArchUnitNET/issues/468 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/39d81dff1184b72573ed0b1225f4b0155475e0e14a8408ce3795d2a0528198e5/TNG/ArchUnitNET/issues/468 |
| og:image:alt | if I understand the original docs of ArchUnit correctly, there should be a difference between (*) and (**). (*) should target the package (**) should target the package and its sub packages See als... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | enolive |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0f5d3ba365b3985d75c32a5957c8635488d58dcf027ae6ae958eee7edaa306a2 |
| turbo-cache-control | no-preview |
| go-import | github.com/TNG/ArchUnitNET git https://github.com/TNG/ArchUnitNET.git |
| octolytics-dimension-user_id | 432256 |
| octolytics-dimension-user_login | TNG |
| octolytics-dimension-repository_id | 198763782 |
| octolytics-dimension-repository_nwo | TNG/ArchUnitNET |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 198763782 |
| octolytics-dimension-repository_network_root_nwo | TNG/ArchUnitNET |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 10bf439485be3d26a6ab4aa27764288fcc5ef6b9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width