Comparing version 7.4.0 to 7.5.0
@@ -31,2 +31,4 @@ #!/usr/bin/env node | ||
const { pathStringify } = require('@philippfromme/moddle-helpers'); | ||
const CONFIG_NAME = '.bpmnlintrc'; | ||
@@ -111,7 +113,17 @@ | ||
function tableEntry(report) { | ||
const category = report.category; | ||
let { | ||
category, | ||
id = '', | ||
message, | ||
name = '', | ||
path | ||
} = report; | ||
if (path) { | ||
id = `${ id }#${ pathStringify(path) }`; | ||
} | ||
const color = category === 'error' ? red : yellow; | ||
return [ report.id || '', color(categoryMap[category] || category), report.message, report.name || '' ]; | ||
return [ id, color(categoryMap[ category ] || category), message, name ]; | ||
} | ||
@@ -118,0 +130,0 @@ |
@@ -9,2 +9,8 @@ # Changelog | ||
## 7.5.0 | ||
* `FEAT`: add optional `path` parameter to `Reporter#report` ([#73](https://github.com/bpmn-io/bpmnlint/pull/73)) | ||
* `FEAT`: add optional `name` parameter to `RuleTester#verify` ([#68](https://github.com/bpmn-io/bpmnlint/pull/68)) | ||
* `CHORE`: update to `bpmn-moddle@7.1.2` | ||
## 7.4.0 | ||
@@ -11,0 +17,0 @@ |
@@ -11,4 +11,16 @@ const traverse = require('./traverse'); | ||
report(id, message) { | ||
this.messages.push({ id, message }); | ||
report(id, message, path) { | ||
let report = { | ||
id, | ||
message | ||
}; | ||
if (path) { | ||
report = { | ||
...report, | ||
path | ||
}; | ||
} | ||
this.messages.push(report); | ||
} | ||
@@ -15,0 +27,0 @@ } |
@@ -36,5 +36,5 @@ /* global it, describe, beforeEach */ | ||
testCases.valid.forEach(({ moddleElement, it: _it }, idx) => ( | ||
testCases.valid.forEach(({ moddleElement, name, it: _it }, idx) => ( | ||
(_it || it)(`test case #${idx + 1}`, function() { | ||
(_it || it)(getTitle(idx, name), function() { | ||
return ( | ||
@@ -58,5 +58,5 @@ Promise.resolve(moddleElement) | ||
testCases.invalid.forEach(({ moddleElement, report, it: _it }, idx) => ( | ||
testCases.invalid.forEach(({ moddleElement, name, report, it: _it }, idx) => ( | ||
(_it || it)(`test case #${idx}`, function() { | ||
(_it || it)(getTitle(idx, name), function() { | ||
@@ -99,5 +99,9 @@ if (!Array.isArray(report)) { | ||
function getTitle(idx, name) { | ||
return `test case #${ idx + 1 }${ name ? ` ${ name }`: '' }`; | ||
} | ||
module.exports = { | ||
verify | ||
verify, | ||
getTitle | ||
}; |
{ | ||
"name": "bpmnlint", | ||
"description": "Validate your BPMN diagrams based on configurable lint rules", | ||
"version": "7.4.0", | ||
"version": "7.5.0", | ||
"main": "lib/index.js", | ||
@@ -40,20 +40,21 @@ "keywords": [ | ||
"dependencies": { | ||
"@philippfromme/moddle-helpers": "^0.1.0", | ||
"ansi-colors": "^4.1.1", | ||
"bpmn-moddle": "^7.0.3", | ||
"bpmn-moddle": "^7.1.2", | ||
"bpmnlint-utils": "^1.0.2", | ||
"cli-table": "^0.3.1", | ||
"cli-table": "^0.3.9", | ||
"color-support": "^1.1.3", | ||
"min-dash": "^3.5.2", | ||
"mri": "^1.1.6", | ||
"min-dash": "^3.8.0", | ||
"mri": "^1.2.0", | ||
"pluralize": "^7.0.0", | ||
"tiny-glob": "^0.2.8" | ||
"tiny-glob": "^0.2.9" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"eslint": "^7.14.0", | ||
"chai": "^4.3.4", | ||
"eslint": "^7.32.0", | ||
"eslint-plugin-bpmn-io": "^0.11.0", | ||
"esm": "^3.2.25", | ||
"execa": "^2.0.3", | ||
"execa": "^2.1.0", | ||
"install-local": "^1.0.0", | ||
"mocha": "^8.2.1", | ||
"mocha": "^8.4.0", | ||
"npm-run-all": "^4.1.5", | ||
@@ -60,0 +61,0 @@ "nyc": "^15.1.0", |
@@ -76,7 +76,9 @@ # bpmnlint | ||
For more details on how to define and consume custom lint rules check out the [bpmnlint-plugin-example](https://github.com/bpmn-io/bpmnlint-plugin-example). | ||
Create your first plug-in using the [plugin creator](https://github.com/nikku/create-bpmnlint-plugin). | ||
Checkout the [bpmnlint-plugin-example](https://github.com/bpmn-io/bpmnlint-plugin-example) for details on how to define, test, and consume custom lint rules. | ||
## License | ||
MIT |
@@ -23,3 +23,3 @@ /** | ||
if (missingCondition) { | ||
reporter.report(flow.id, 'Sequence flow is missing condition'); | ||
reporter.report(flow.id, 'Sequence flow is missing condition', [ 'conditionExpression' ]); | ||
} | ||
@@ -26,0 +26,0 @@ }); |
@@ -28,3 +28,3 @@ const { | ||
if (eventDefinitions.length === 0) { | ||
reporter.report(flowElement.id, 'Start event is missing event definition'); | ||
reporter.report(flowElement.id, 'Start event is missing event definition', [ 'eventDefinitions' ]); | ||
} | ||
@@ -31,0 +31,0 @@ }); |
@@ -53,3 +53,3 @@ const { | ||
if (name.length === 0) { | ||
reporter.report(node.id, 'Element is missing label/name'); | ||
reporter.report(node.id, 'Element is missing label/name', [ 'name' ]); | ||
} | ||
@@ -56,0 +56,0 @@ } |
@@ -20,3 +20,3 @@ const { | ||
if (eventDefinitions.length > 1) { | ||
reporter.report(node.id, 'Event has multiple event definitions'); | ||
reporter.report(node.id, 'Event has multiple event definitions', [ 'eventDefinitions' ]); | ||
} | ||
@@ -23,0 +23,0 @@ } |
@@ -29,3 +29,3 @@ const { | ||
if (eventDefinitions.length > 0) { | ||
reporter.report(flowElement.id, 'Start event must be blank'); | ||
reporter.report(flowElement.id, 'Start event must be blank', [ 'eventDefinitions' ]); | ||
} | ||
@@ -32,0 +32,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55072
1599
84
10
1
+ Added@philippfromme/moddle-helpers@0.1.0(transitive)
Updatedbpmn-moddle@^7.1.2
Updatedcli-table@^0.3.9
Updatedmin-dash@^3.8.0
Updatedmri@^1.2.0
Updatedtiny-glob@^0.2.9