bpmn-io / bpmnlint

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

feat: failure on warning #91

Closed thecampagnards closed 2 years ago

thecampagnards commented 2 years ago

Hello, I suggest this pr to exit 1 when a warning appears. I added a flag --failure-on-warning or -f to activate it when you want. We need it to force the failure of our CI in case of warnings. Thx!

nikku commented 2 years ago

Great addition. Does there exist prior art, i.e. does eslint offer a similar flag?

thecampagnards commented 2 years ago

Great addition. Does there exist prior art, i.e. does eslint offer a similar flag?

Yes they have ˋ --max-warnings` https://eslint.org/docs/latest/user-guide/command-line-interface#max-warnings I can change to that

nikku commented 2 years ago

Please change to that. Also enhances the feature. :+1:

thecampagnards commented 2 years ago

updated + fixed lint issues

thecampagnards commented 2 years ago

@nikku I dont understand why the it doesnt work can you help me pls ?

  5) cli
       should execute
         bpmnlint --max-warnings=3 diagram-warnings.bpmn:

      AssertionError: expected '' to deeply equal '\n\n/home/ksidorenko/workspace/bpmnlint/test/integration/cli/diagram-warnings.bpmn\n  Activity_14kz74k  warning  Incoming flows do not join  fake-join\n  Activity_1b4a52y  warning  Incoming flows do not join  fake-join\n\n✖ 2 problems (0 errors, 2 warnings)\n'
      + expected - actual

      +
      +
      +/home/ksidorenko/workspace/bpmnlint/test/integration/cli/diagram-warnings.bpmn
      +  Activity_14kz74k  warning  Incoming flows do not join  fake-join
      +  Activity_1b4a52y  warning  Incoming flows do not join  fake-join
      +
      +✖ 2 problems (0 errors, 2 warnings)

it seems that the output is not taken into account

nikku commented 2 years ago

Fixed + incorporated some nit-picks into https://github.com/bpmn-io/bpmnlint/pull/92.