-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rules): attach documentation URLs
Previously we injected them via camunda/linting, now we can use the new meta infrastructure provided by bpmnlint itself. Related to bpmn-io/bpmnlint#165
- Loading branch information
Showing
9 changed files
with
68 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const modelingGuidanceBaseUrl = 'https://docs.camunda.io/docs/next/components/modeler/reference/modeling-guidance/rules'; | ||
|
||
/** | ||
* @typedef { any } RuleDefinition | ||
*/ | ||
|
||
/** | ||
* Annotate a rule with core information, such as the documentation url. | ||
* | ||
* @param { string } ruleName | ||
* @param { RuleDefinition } options | ||
* | ||
* @return { RuleDefinition } | ||
*/ | ||
function annotateRule(ruleName, options) { | ||
|
||
const { | ||
meta: { | ||
documentation = {}, | ||
...restMeta | ||
} = {}, | ||
...restOptions | ||
} = options; | ||
|
||
const documentationUrl = `${modelingGuidanceBaseUrl}/${ruleName}.md`; | ||
|
||
return { | ||
meta: { | ||
documentation: { | ||
url: documentationUrl, | ||
...documentation | ||
}, | ||
...restMeta | ||
}, | ||
...restOptions | ||
}; | ||
} | ||
|
||
module.exports.annotateRule = annotateRule; |