-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(decorators): validate decorators against model #916
Merged
Conversation
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
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
mttrbrts
reviewed
Oct 3, 2024
@@ -762,8 +781,10 @@ class BaseModelManager { | |||
fromAst(ast) { | |||
this.clearModelFiles(); | |||
ast.models.forEach( model => { | |||
const modelFile = new ModelFile( this, model ); | |||
this.addModelFile( modelFile, null, null, true ); | |||
if(model.namespace !== '[email protected]') { // excludes the Concerto namespace, already added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a system utility (in concerto-util, I think), that identifies system namespaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't see that...
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
Co-authored-by: Sanket Shevkar <[email protected]>
Co-authored-by: Sanket Shevkar <[email protected]>
* fix(decorator): validate type references * chore(deps): update concerto-metamodel to 3.10.1 * chore(npm): move to npm workspaces * chore(concerto-util): remove axios and colors Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: GitHub <[email protected]> Co-authored-by: dselman <[email protected]> Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
Signed-off-by: Dan Selman <[email protected]>
…ject/concerto into ds-validate-decorators
Signed-off-by: Dan Selman <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #391
Adds a new option to the model manager to validate the names and structure of decorators and their arguments:
Changes
Documentation updates: accordproject/concerto-docs#61
Using this Model Manager configuration:
This file will error, because it uses the undeclared decorator
@Hide
:While this file will not:
Flags
defaultNamespace
to support decorating model managers with command sets when the model managerdecoratorValidation
option is ON. See below.[email protected]
that defines the abstractDecorator
type.The Decorator Command Set model has been updated to support an optional
namespace
property forDecoratorCommand.decorator
(in addition to the existing decorator name). This is required so that the DecoratorManager can create imports for the decorators that are being added to a model file. If the namespace property is missing on a decorator command then thedefaultNamespace
option passed to DecoratorManager is used. If both are null and a decorator is applied, and decoratorValidation is ON then the model file will be flagged by the model manager as invalid.Screenshots or Video
Related Issues
Author Checklist
--signoff
option of git commit.main
fromfork:branchname