bpmn-io / bpmnlint

Validate BPMN diagrams based on configurable lint rules.
MIT License
120 stars 37 forks source link

Allow to use moddle extensions in the CLI tool #62

Open barmac opened 3 years ago

barmac commented 3 years ago

Is your feature request related to a problem? Please describe

In my favourite ruleset, I use a rule which requires Camunda namespace to be present. I cannot use it now with the CLI tool.

Describe the solution you'd like

I want to be able to load moddle extensions when I use the CLI tool.

This could be done via configuration:

.bpmnlinrc

{
  "moddleExtensions": [
    "camunda-bpmn-moddle/resources/camunda.json",
    "./nyan-cat.json"
  ],
  "extends": [
    "bpmnlint:recommended",
    "plugin:camunda/recommended"
  ],
  "rules": {
    "nyan-cat": "error"
  }
}

Describe alternatives you've considered

Rulesets could declare their moddle extensions in a similar way:

module.exports = {
  configs: {
    recommended: {
      moddleExtensions: [
        "camunda-bpmn-moddle/resources/camunda.json"
      ],
      rules: {
        'camunda/avoid-lanes': 'warn',
        'camunda/forking-conditions': 'error',
        'camunda/no-collapsed-sub-processes': 'error'
      }
    }
  }
};

Additional context

barmac commented 2 years ago

I am dropping this issue as it requires additional time which I don't have now. The WIP result is on https://github.com/bpmn-io/bpmnlint/tree/62-moddle-extension-experiments