jraska / jraska/modules-graph-assert

Regex variables/found groups

Open
#326 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
640
Forks
35
Avg merge
2d 21h
Merged PRs (30d)
1

Description

I would like to have usable groups found in regex to use in the condition.

For example modules:

  • composeApp
  • libUi
  • libImpl
  • testUi
  • testImpl
  • another

Would like to specify that Ui modules could depends only its impl module.
It means libUi could depends ONLY libImpl and no more impl modules.
The same for testUi could depends only testImpl. There is prohibited to depends libImpl from testUi.

So i would like to specify regex like: (.*)Ui
Which means there are two groups:
0. all the string

  1. (.*) before Ui string, that means for libUi it is lib string

And then in allowed array would like to write something like:

moduleGraphAssert {
    configurations += setOf("commonMainImplementation", "commonMainApi")
    maxHeight = 3
    allowed = arrayOf(
        "(.*)Ui$ -> $1lib$",
    )
    restricted = arrayOf(
    )
    assertOnAnyBuild = true
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the moduleGraphAssert configuration and the parsing of allowed and restricted rules. Compare the (.*)Ui$ -> $1lib$ example against the listed module names; done means captured regex groups can be referenced in allowed rules and the stated Ui/impl restrictions are expressible.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.