"""__init__.py module for the No Ext for Final plugin."""# WARNING - DO NOT EDIT - YOUR CHANGES WILL NOT BE PROTECTED.# This file is auto-generated by the aac gen-plugin and may be overwritten.fromos.pathimportjoin,dirnamefromtypingimportAnyfromaac.execute.aac_execution_resultimport(ExecutionResult,)fromaac.executeimporthookimplfromaac.context.language_contextimportLanguageContextfromaac.context.definitionimportDefinitionfromaac.execute.plugin_runnerimportPluginRunnerfromaac.plugins.no_ext_for_final.no_ext_for_final_implimportplugin_namefromaac.plugins.no_ext_for_final.no_ext_for_final_implimportno_extension_for_finalno_ext_for_final_aac_file_name="no_ext_for_final.aac"
[docs]defrun_no_extension_for_final(instance:Any,definition:Definition,defining_schema,arguments:Any)->ExecutionResult:"""Check every schema for extension entries that are marked with a final modifier."""returnno_extension_for_final(instance,definition,defining_schema)
[docs]@hookimpldefregister_plugin()->None:""" Returns information about the plugin. Returns: A collection of information about the plugin and what it contributes. """active_context=LanguageContext()no_ext_for_final_aac_file=join(dirname(__file__),no_ext_for_final_aac_file_name)definitions=active_context.parse_and_load(no_ext_for_final_aac_file)no_ext_for_final_plugin_definition=[definitionfordefinitionindefinitionsifdefinition.name==plugin_name][0]plugin_instance=no_ext_for_final_plugin_definition.instanceforfile_to_loadinplugin_instance.definition_sources:active_context.parse_and_load(file_to_load)plugin_runner=PluginRunner(plugin_definition=no_ext_for_final_plugin_definition)plugin_runner.add_constraint_callback("No Extension for Final",run_no_extension_for_final)active_context.register_plugin_runner(plugin_runner)