-
Notifications
You must be signed in to change notification settings - Fork 7
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
Update Core Spec to adhere to the Style Guide #619
Update Core Spec to adhere to the Style Guide #619
Conversation
For the removed |
…nnet/i-want-the-core-spec-602
…reference primitive
@@ -61,7 +61,7 @@ async def test_get_semantic_tokens_for_enum(self): | |||
|
|||
props = { | |||
enum.name: { | |||
enum.get_root_key(): (SemanticTokenTypes.Keyword, 0b11), | |||
enum.get_root_key(): (SemanticTokenTypes.Keyword, 0b10), |
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.
Updated this to reflect the change in behavior in the token provider. I believe the 3 -> 2 change is because a number of these names no longer match the root key, which means it matches with one fewer of the bitmask checks.
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.
I think we still want this to be 0b11
as the bitmask indicates that a token is readonly and it is defined in the default library - i.e. defined in the core spec. As such, I think these root keys should always have both modifiers - i.e. 0b11
. I think we need a slight modification of the logic in those two functions (linked above).
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.
Hmm. Why are we considering root keys as readonly?
- Cameron and I discussed this offline and we decided it be best to review the categories of the tokens in general. That tasking has been captured in Review the Semantic Token Provider categorizations #624
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.
Good job, so far. I have a few comments.
@@ -61,7 +61,7 @@ async def test_get_semantic_tokens_for_enum(self): | |||
|
|||
props = { | |||
enum.name: { | |||
enum.get_root_key(): (SemanticTokenTypes.Keyword, 0b11), | |||
enum.get_root_key(): (SemanticTokenTypes.Keyword, 0b10), |
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.
I think we still want this to be 0b11
as the bitmask indicates that a token is readonly and it is defined in the default library - i.e. defined in the core spec. As such, I think these root keys should always have both modifiers - i.e. 0b11
. I think we need a slight modification of the logic in those two functions (linked above).
Co-authored-by: Cameron Chaparro <cvchaparro@users.noreply.github.com>
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.
Nice!
* I want a `Plugin` root key and schema (#500) * Add Plugin and PluginCommand to spec.yaml * Update describe-definition to take a reference * Make ValidationReference and DefinitionReference actual references * Spelling * Improve naming * Add command group schema and update plugin command schema * Add a display name to command groups * Add a display name to commands * Update the gen-plugin architecture definition * Update references.py Clean up, refactor, and fix tests. * Replace hard-coded string values with constants * Update material model plugin definition * Update commandGroup description * Convert version plugin definition * Convert validate plugin definition * Fix goto definition test * Convert gen_design_doc plugin definition * Convert active_context plugin definition * Put common command group definitions in spec.yaml * Convert gen_gherkin_behaviors plugin definition * Convert gen_json plugin definition * Convert gen_protobuf plugin definition * Convert help_dump plugin definition * Convert gen_plant_uml plugin definition * Convert lsp_server plugin definition * Convert plugin_management plugin definition * Convert print_spec plugin definition * Convert rest_api plugin definition * Convert specifications plugin definition * Put descriptions on the same line * Dedup constants that refer to the import root key * Fix gen-protobuf test and minor cleanup * More fixes for gen-gherkin-behaviors * Keep up with spec.yaml changes * Fix reference tests * Update validator plugin definitions * Make plugin definition files consistent * Update definitions for primitive type checking plugin * Update validators Also, make the `when' step of validators read the same. * Update docs * Update plugin names in implementation files * Fix imports * Fix test file names * Fix plugin management plugin tests * Fix gen-design-doc generated output after template engine changes A while ago we made changes to the template engine that made it so that we didn't have to do as much spacing management in templates and this plugin never got updated. * Fix tests failing as a result of plugin name update Now that plugin name doesn't necessarily equal the validation name for validations, we need a way to distinguish between them. * Rename usage of generate-openapi-spec to gen-openapi-spec Update the OpenAPI spec generation command name for consistency with other generation commands. * Update plugin.yaml Update the test plugin file to fully exercise plugin generation features. * Add a few more definition field constants * Update gen-plugin and tests * Fix name * Use updated field * Put test helpers in another package * Specify VALIDATION_NAME for each plugin * Add description for `name' argument * Add the right command dictionary * Update clear_directory * Initial updates to templates to acommodate new plugin format * Updates gen plugin and tests Update test with correct number of plugin files. Move all plugin definition source files to the plugin directory for third-party plugins. * Fix things * Try fixing docstring, again * Updates to the pipeline * Test plugin definition file updates Add the test validation definitions. Use relative file path on definition source value. Switch command from description to helpText. * Ignore D417 warnings in tests/ directory * Update gen-openapi-spec command name * Update validator implementation validation We only need to care about validation implementations that are contributed by active plugins. * Update pipeline * Fix flake8 warnings * Fix command name * Just use constructor for validation contributions * Update validate validator implementation test * Address the comment for TemporaryTestFile * Fix parameters * Fixes to TemporaryTestFile * Update tests.helpers.io package Also, since we're already touching these files go ahead and change references from temporary_test_file to TemporaryTestFile. * Use validator.optional * Apply suggestions from code review * Use an Enum instead of strings for the clean_up option * Remove workaround for missing validator implementations in tests * Promote specifications to core aac language (#559) * initial mods, no testing yet * removed commented out code * Add Plugin and PluginCommand to spec.yaml * Update describe-definition to take a reference * Make ValidationReference and DefinitionReference actual references * Spelling * Improve naming * Add command group schema and update plugin command schema * Add a display name to command groups * Add a display name to commands * Update the gen-plugin architecture definition * Update references.py Clean up, refactor, and fix tests. * Replace hard-coded string values with constants * Update material model plugin definition * Update commandGroup description * Convert version plugin definition * Convert validate plugin definition * Fix goto definition test * Convert gen_design_doc plugin definition * Convert active_context plugin definition * Put common command group definitions in spec.yaml * Convert gen_gherkin_behaviors plugin definition * Convert gen_json plugin definition * Convert gen_protobuf plugin definition * Convert help_dump plugin definition * Convert gen_plant_uml plugin definition * Convert lsp_server plugin definition * Convert plugin_management plugin definition * Convert print_spec plugin definition * Convert rest_api plugin definition * Convert specifications plugin definition * Put descriptions on the same line * Dedup constants that refer to the import root key * Fix gen-protobuf test and minor cleanup * More fixes for gen-gherkin-behaviors * Keep up with spec.yaml changes * Fix reference tests * Update validator plugin definitions * Make plugin definition files consistent * Update definitions for primitive type checking plugin * Update validators Also, make the `when' step of validators read the same. * Update docs * Update plugin names in implementation files * Fix imports * Fix test file names * Fix plugin management plugin tests * Fix gen-design-doc generated output after template engine changes A while ago we made changes to the template engine that made it so that we didn't have to do as much spacing management in templates and this plugin never got updated. * Fix tests failing as a result of plugin name update Now that plugin name doesn't necessarily equal the validation name for validations, we need a way to distinguish between them. * Rename usage of generate-openapi-spec to gen-openapi-spec Update the OpenAPI spec generation command name for consistency with other generation commands. * Update plugin.yaml Update the test plugin file to fully exercise plugin generation features. * Add a few more definition field constants * Update gen-plugin and tests * Fix name * Use updated field * Put test helpers in another package * Specify VALIDATION_NAME for each plugin * Add description for `name' argument * Add the right command dictionary * Update clear_directory * Initial updates to templates to acommodate new plugin format * Updates gen plugin and tests Update test with correct number of plugin files. Move all plugin definition source files to the plugin directory for third-party plugins. * Fix things * Try fixing docstring, again * Updates to the pipeline * Test plugin definition file updates Add the test validation definitions. Use relative file path on definition source value. Switch command from description to helpText. * Ignore D417 warnings in tests/ directory * Update gen-openapi-spec command name * Update validator implementation validation We only need to care about validation implementations that are contributed by active plugins. * Update pipeline * Fix flake8 warnings * Fix command name * Just use constructor for validation contributions * Update validate validator implementation test * Address the comment for TemporaryTestFile * Fix parameters * Fixes to TemporaryTestFile * Update tests.helpers.io package Also, since we're already touching these files go ahead and change references from temporary_test_file to TemporaryTestFile. * Use validator.optional * Apply suggestions from code review * Fix tests after merging * Rename usages of DEFINITION_NAME_SCHEMA to ROOT_KEY_SCHEMA * Remove original test_gen_plugin in favor of test_gen_plugin_impl * Update requirement-related validations * Fix validators * Use an Enum instead of strings for the clean_up option * Remove workaround for missing validator implementations in tests * Fix test failures * Simplify * Clean up --------- Co-authored-by: Cameron Chaparro <cameron.chaparro@zadentech.com> Co-authored-by: Cameron Chaparro <cvchaparro@users.noreply.github.com> * Make the import keyword a file wide declaration (#612) * Update import root key in spec * Update parser tests Fix constant names and use the file name constants to define imports. * Update gen_plugin tests * Fix goto definition test * Update parser handling of imports * Update document link provider * Fix the document link provider test * Formatting * Make sure we handle multiple import definitions per file My intuition tells me this would be an antipattern but I think we should handle that using a linting validator, rather than throwing an error. * Update imports in models * Make sure we provide imports list as a field * Minor doc updates * Add comments to documentation about imports * Update docs * Update spec.yaml with a definition structure for imports * Update import references in definition files * Update imports to use the new files field * Update docstring * Update README.md * 615 remove the material plugin (#616) * removed material plugin * remove unit test and sample model * disabled test that relied on material plugin model * Removed skip test annotation and got the test working. --------- Co-authored-by: Alex Monnet <alexcmonnet@gmail.com> * AaC Style Guide (#613) * Added user documentation on the AaC DSL Style Guide Co-authored-by: Cameron Chaparro <cvchaparro@users.noreply.github.com> * Update Core Spec to adhere to the Style Guide (#619) * Updated the Core Spec to adhere to the AaC Style Guide * Updated example models to adhere to the AaC Style Guide * Updated first-party plugins to adhere to the AaC Style Guide Co-authored-by: Cameron Chaparro <cvchaparro@users.noreply.github.com> * Version bump * Update Extension test * Removed duplication spec consant * Update dupe spec reference * Removed unused constant * Update gen puml yaml to use commands * Readded nixed file docstring * Moved genjson to commands * Added parser error handling in line with the YAML error handling. * Fixed parser import --------- Co-authored-by: Cameron Chaparro <cvchaparro@users.noreply.github.com> Co-authored-by: Cameron Chaparro <cameron.chaparro@zadentech.com> Co-authored-by: Jondavid Black <36022341+jondavid-black@users.noreply.github.com>
Description
Update the Core Spec to adhere to the style guide.
Linked Items:
Please include the items resolved by and/or associated with this Pull Request using the following syntax to link them for closure upon completion.
Closes #602
Type of change
Feature Additions
Include pertinent changes as a result of adding the new feature.
Bug Fixes
Include pertinent changes of fixing the bug.
Breaking Changes
Include pertinent changes that qualify as breaking changes. Be sure to include information about the impact to end users and additional information for addressing the break if more than a version transition is necessary for mitigating.
schema
definition is now namedSchema
model
definition is now namedModel
root
definition is now namedRoot
enum
definition is now namedEnum
extension
definition is now namedExtension
BehaviorType
's value are now UPPER_CASEpub-sub
is nowPUB_SUB
request-response
is nowREQUEST_RESPONSE
startup
is nowSTARTUP
timer
is nowTIMER
logging
is nowLOGGING
Map
was moved to Gen-ProtobufKeyValuePair
was moved to Gen-ProtobufDefinitionReference
as its been replaced by the primitive typereference
Feature Improvement Changes
Include pertinent changes that are improvements to existing features.
Checklist: