README.md 1.22 KiB
Newer Older
Chevdor's avatar
Chevdor committed
# Ruled Labels
Chevdor's avatar
Chevdor committed

Chevdor's avatar
Chevdor committed
{Ruled-Labels} is compatible with the `glabel` yaml format and allow specifying additionnal rules regarding the labels. Those rules are described in a yaml file.
Chevdor's avatar
Chevdor committed

Chevdor's avatar
Chevdor committed
{Ruled-Labels} is aware of:
Chevdor's avatar
Chevdor committed

Chevdor's avatar
Chevdor committed
-   the list of labels and their properties
Chevdor's avatar
Chevdor committed

Chevdor's avatar
Chevdor committed
-   the parsing rules
Chevdor's avatar
Chevdor committed

Chevdor's avatar
Chevdor committed
-   the label rules

## cli
Chevdor's avatar
Chevdor committed

The cli can be used as by passing the labels extracted from an issue/PR:

    rl list --rules labels.yaml
    rl lint --rules labels.yaml

    rl check --label "B0-silent" --label "B1-note_worthy" --rules labels.yaml
    rl check --labels "B0-silent,B1-note_worthy" --rules labels.yaml --only b_rules --only b_excludes_j
    rl check --labels "B0-silent,B1-note_worthy" --rules labels.yaml --exclude b_rules --only b_excludes_j

    rl test --tests tests.yaml

If all the rules pass, `rl` returns 0.

Chevdor's avatar
Chevdor committed
## Weights
Chevdor's avatar
Chevdor committed

In some case, you may want to enforce that some rules are applied before or after others.
By default, rules have a priority of `100`. Any rule with a lower priority will be applied before those with higher prio.
Chevdor's avatar
Chevdor committed

## Vscode yaml

Add to the yaml pluggin config:

        "yaml.customTags": [
            "!none_of sequence",
            "!one_of sequence",
            "!some_of sequence",
            "!all_of sequence",
        ]