bpmnlint 8.0.0 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/bpmnlint.js +11 -5
  2. package/package.json +1 -1
package/bin/bpmnlint.js CHANGED
@@ -41,11 +41,13 @@ Usage
41
41
  $ bpmnlint diagram.bpmn
42
42
 
43
43
  Options
44
- --config, -c Path to configuration file. It overrides .bpmnlintrc if present.
45
- --init Generate a .bpmnlintrc file in the current working directory
44
+ --config, -c Path to configuration file. It overrides .bpmnlintrc if present
45
+ --init Generate a .bpmnlintrc file in the current working directory
46
+ --max-warnings Number of warnings to trigger nonzero exit code - default: -1
46
47
 
47
48
  Examples
48
49
  $ bpmnlint ./invoice.bpmn
50
+ $ bpmnlint --max-warnings=0 '*.bpmn'
49
51
  $ bpmnlint --init
50
52
 
51
53
  `;
@@ -288,7 +290,7 @@ async function lintDiagram(diagramPath, config) {
288
290
  }
289
291
  }
290
292
 
291
- async function lint(files, config) {
293
+ async function lint(files, config, maxWarnings) {
292
294
 
293
295
  let errorCount = 0;
294
296
  let warningCount = 0;
@@ -321,7 +323,7 @@ async function lint(files, config) {
321
323
  ));
322
324
  }
323
325
 
324
- if (errorCount) {
326
+ if (errorCount || (maxWarnings !== -1 && warningCount > maxWarnings)) {
325
327
  process.exit(1);
326
328
  }
327
329
 
@@ -334,11 +336,15 @@ async function run() {
334
336
  init,
335
337
  version,
336
338
  config: configOverridePath,
339
+ 'max-warnings': maxWarnings,
337
340
  _: files
338
341
  } = mri(process.argv.slice(2), {
339
342
  string: [ 'config' ],
340
343
  alias: {
341
344
  c: 'config'
345
+ },
346
+ default: {
347
+ 'max-warnings': -1
342
348
  }
343
349
  });
344
350
 
@@ -393,7 +399,7 @@ Learn more about configuring bpmnlint: https://github.com/bpmn-io/bpmnlint#confi
393
399
 
394
400
  const actualFiles = await glob(files);
395
401
 
396
- return lint(actualFiles, config);
402
+ return lint(actualFiles, config, maxWarnings);
397
403
  }
398
404
 
399
405
  run().catch(errorAndExit);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bpmnlint",
3
3
  "description": "Validate your BPMN diagrams based on configurable lint rules",
4
- "version": "8.0.0",
4
+ "version": "8.1.0",
5
5
  "main": "lib/index.js",
6
6
  "keywords": [
7
7
  "bpmnlint",