periplus-map 0.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. periplus/__init__.py +70 -0
  2. periplus/checkmap.py +80 -0
  3. periplus/cli.py +658 -0
  4. periplus/contract/schema/map.schema.json +138 -0
  5. periplus/contract/schema/navigation.schema.json +200 -0
  6. periplus/contract/schema/pack-file.schema.json +1405 -0
  7. periplus/contract/schema/pack-manifest.schema.json +245 -0
  8. periplus/contract/schema/project-settings.schema.json +85 -0
  9. periplus/contract/spec/engine.md +151 -0
  10. periplus/contract/spec/rules.md +352 -0
  11. periplus/detect.py +228 -0
  12. periplus/engine/__init__.py +5 -0
  13. periplus/engine/check.py +481 -0
  14. periplus/engine/emit.py +368 -0
  15. periplus/engine/packload.py +2321 -0
  16. periplus/engine/pattern.py +27 -0
  17. periplus/engine/rules.py +1946 -0
  18. periplus/engine/select.py +491 -0
  19. periplus/engine/source.py +172 -0
  20. periplus/engine/tree.py +424 -0
  21. periplus/errors.py +332 -0
  22. periplus/init.py +358 -0
  23. periplus/layout.py +28 -0
  24. periplus/manifest.py +498 -0
  25. periplus/map.py +364 -0
  26. periplus/navigate/__init__.py +1 -0
  27. periplus/navigate/find.py +143 -0
  28. periplus/navigate/ids.py +30 -0
  29. periplus/navigate/listing.py +42 -0
  30. periplus/navigate/mapfile.py +189 -0
  31. periplus/navigate/path.py +175 -0
  32. periplus/navigate/show.py +175 -0
  33. periplus/navigate/types.py +83 -0
  34. periplus/navigate/walk.py +138 -0
  35. periplus/packs/advancedqueue_basic@0.0.1/pack.yaml +14 -0
  36. periplus/packs/advancedqueue_basic@0.0.1/queue_job_type/queue_job_type.yaml +9 -0
  37. periplus/packs/advancedqueue_basic@0.0.1/queue_job_type/queue_job_type_annotation.yaml +43 -0
  38. periplus/packs/advancedqueue_basic@0.0.1/queue_job_type/queue_job_type_attribute.yaml +43 -0
  39. periplus/packs/ai_basic@0.0.1/ai_agent/ai_agent.yaml +8 -0
  40. periplus/packs/ai_basic@0.0.1/ai_agent/ai_agent_attribute.yaml +43 -0
  41. periplus/packs/ai_basic@0.0.1/ai_function_call/ai_function_call.yaml +8 -0
  42. periplus/packs/ai_basic@0.0.1/ai_function_call/ai_function_call_attribute.yaml +43 -0
  43. periplus/packs/ai_basic@0.0.1/pack.yaml +15 -0
  44. periplus/packs/config_pages_basic@0.0.1/bundle/config_pages_bundle_config.yaml +54 -0
  45. periplus/packs/config_pages_basic@0.0.1/pack.yaml +11 -0
  46. periplus/packs/crop_basic@0.0.1/bundle/crop_bundle_config.yaml +54 -0
  47. periplus/packs/crop_basic@0.0.1/pack.yaml +11 -0
  48. periplus/packs/drupal@0.1.0/block/block_placement.yaml +25 -0
  49. periplus/packs/drupal@0.1.0/block/block_placement_code.yaml +58 -0
  50. periplus/packs/drupal@0.1.0/block/block_placement_config.yaml +53 -0
  51. periplus/packs/drupal@0.1.0/block/block_plugin.yaml +52 -0
  52. periplus/packs/drupal@0.1.0/block/block_plugin_altered.yaml +61 -0
  53. periplus/packs/drupal@0.1.0/block/block_plugin_annotation.yaml +69 -0
  54. periplus/packs/drupal@0.1.0/block/block_plugin_attribute.yaml +56 -0
  55. periplus/packs/drupal@0.1.0/block/block_plugin_content.yaml +46 -0
  56. periplus/packs/drupal@0.1.0/block/block_plugin_derived.yaml +110 -0
  57. periplus/packs/drupal@0.1.0/block/block_plugin_deriver.yaml +30 -0
  58. periplus/packs/drupal@0.1.0/block/block_type.yaml +14 -0
  59. periplus/packs/drupal@0.1.0/block/block_type_code.yaml +43 -0
  60. periplus/packs/drupal@0.1.0/block/block_type_config.yaml +45 -0
  61. periplus/packs/drupal@0.1.0/cache/cache.yaml +18 -0
  62. periplus/packs/drupal@0.1.0/cache/cache_backend.yaml +31 -0
  63. periplus/packs/drupal@0.1.0/component/sdc.yaml +19 -0
  64. periplus/packs/drupal@0.1.0/component/sdc_definition.yaml +25 -0
  65. periplus/packs/drupal@0.1.0/component/sdc_use.yaml +25 -0
  66. periplus/packs/drupal@0.1.0/config/config_object.yaml +65 -0
  67. periplus/packs/drupal@0.1.0/display/display.yaml +32 -0
  68. periplus/packs/drupal@0.1.0/display/display_code.yaml +53 -0
  69. periplus/packs/drupal@0.1.0/display/display_config.yaml +95 -0
  70. periplus/packs/drupal@0.1.0/entity/entity.yaml +33 -0
  71. periplus/packs/drupal@0.1.0/entity/entity_class.yaml +60 -0
  72. periplus/packs/drupal@0.1.0/entity/entity_save.yaml +27 -0
  73. periplus/packs/drupal@0.1.0/entity/entity_type_annotation.yaml +85 -0
  74. periplus/packs/drupal@0.1.0/entity/entity_type_attribute.yaml +76 -0
  75. periplus/packs/drupal@0.1.0/field/field_instance_code.yaml +40 -0
  76. periplus/packs/drupal@0.1.0/field/field_instance_config.yaml +58 -0
  77. periplus/packs/drupal@0.1.0/field/field_storage.yaml +37 -0
  78. periplus/packs/drupal@0.1.0/field/field_storage_code.yaml +39 -0
  79. periplus/packs/drupal@0.1.0/field/field_storage_config.yaml +24 -0
  80. periplus/packs/drupal@0.1.0/form/form.yaml +48 -0
  81. periplus/packs/drupal@0.1.0/form/form_class.yaml +50 -0
  82. periplus/packs/drupal@0.1.0/form/form_id.yaml +48 -0
  83. periplus/packs/drupal@0.1.0/form/form_methods.yaml +39 -0
  84. periplus/packs/drupal@0.1.0/hook/hook.yaml +8 -0
  85. periplus/packs/drupal@0.1.0/hook/hook_attribute.yaml +28 -0
  86. periplus/packs/drupal@0.1.0/module/module.yaml +8 -0
  87. periplus/packs/drupal@0.1.0/module/module_info.yaml +50 -0
  88. periplus/packs/drupal@0.1.0/pack.yaml +184 -0
  89. periplus/packs/drupal@0.1.0/plugin/plugin.yaml +17 -0
  90. periplus/packs/drupal@0.1.0/plugin/plugin_annotation.yaml +120 -0
  91. periplus/packs/drupal@0.1.0/recommendations/recommendations.yaml +14 -0
  92. periplus/packs/drupal@0.1.0/service/service.yaml +19 -0
  93. periplus/packs/drupal@0.1.0/service/service_autowire.yaml +28 -0
  94. periplus/packs/drupal@0.1.0/service/service_definition.yaml +24 -0
  95. periplus/packs/drupal@0.1.0/service/service_use.yaml +43 -0
  96. periplus/packs/drupal_basic@0.3.0/action/action.yaml +9 -0
  97. periplus/packs/drupal_basic@0.3.0/action/action_annotation.yaml +43 -0
  98. periplus/packs/drupal_basic@0.3.0/action/action_attribute.yaml +43 -0
  99. periplus/packs/drupal_basic@0.3.0/block/block_placement.yaml +16 -0
  100. periplus/packs/drupal_basic@0.3.0/block/block_placement_config.yaml +51 -0
  101. periplus/packs/drupal_basic@0.3.0/block_plugin/block_plugin.yaml +14 -0
  102. periplus/packs/drupal_basic@0.3.0/block_plugin/block_plugin_annotation.yaml +47 -0
  103. periplus/packs/drupal_basic@0.3.0/block_plugin/block_plugin_attribute.yaml +43 -0
  104. periplus/packs/drupal_basic@0.3.0/block_type/block_type.yaml +8 -0
  105. periplus/packs/drupal_basic@0.3.0/block_type/block_type_config.yaml +54 -0
  106. periplus/packs/drupal_basic@0.3.0/boundary/boundary_types.yaml +19 -0
  107. periplus/packs/drupal_basic@0.3.0/bundle/bundle.yaml +20 -0
  108. periplus/packs/drupal_basic@0.3.0/bundle/bundle_config.yaml +393 -0
  109. periplus/packs/drupal_basic@0.3.0/call/call.yaml +349 -0
  110. periplus/packs/drupal_basic@0.3.0/component/component.yaml +30 -0
  111. periplus/packs/drupal_basic@0.3.0/config/config_object.yaml +119 -0
  112. periplus/packs/drupal_basic@0.3.0/constraint/constraint.yaml +8 -0
  113. periplus/packs/drupal_basic@0.3.0/constraint/constraint_annotation.yaml +43 -0
  114. periplus/packs/drupal_basic@0.3.0/constraint/constraint_attribute.yaml +43 -0
  115. periplus/packs/drupal_basic@0.3.0/display/display.yaml +30 -0
  116. periplus/packs/drupal_basic@0.3.0/display/display_config.yaml +203 -0
  117. periplus/packs/drupal_basic@0.3.0/display/display_mode_config.yaml +60 -0
  118. periplus/packs/drupal_basic@0.3.0/entity_type/config_entity_type_annotation.yaml +46 -0
  119. periplus/packs/drupal_basic@0.3.0/entity_type/config_entity_type_attribute.yaml +43 -0
  120. periplus/packs/drupal_basic@0.3.0/entity_type/content_entity_type_annotation.yaml +46 -0
  121. periplus/packs/drupal_basic@0.3.0/entity_type/content_entity_type_attribute.yaml +43 -0
  122. periplus/packs/drupal_basic@0.3.0/entity_type/entity_type.yaml +16 -0
  123. periplus/packs/drupal_basic@0.3.0/field/field_instance_config.yaml +116 -0
  124. periplus/packs/drupal_basic@0.3.0/field/field_storage.yaml +21 -0
  125. periplus/packs/drupal_basic@0.3.0/field/field_storage_config.yaml +45 -0
  126. periplus/packs/drupal_basic@0.3.0/field_formatter/field_formatter.yaml +8 -0
  127. periplus/packs/drupal_basic@0.3.0/field_formatter/field_formatter_annotation.yaml +46 -0
  128. periplus/packs/drupal_basic@0.3.0/field_formatter/field_formatter_attribute.yaml +43 -0
  129. periplus/packs/drupal_basic@0.3.0/field_type/field_type_annotation.yaml +46 -0
  130. periplus/packs/drupal_basic@0.3.0/field_type/field_type_attribute.yaml +50 -0
  131. periplus/packs/drupal_basic@0.3.0/field_widget/field_widget_annotation.yaml +46 -0
  132. periplus/packs/drupal_basic@0.3.0/field_widget/field_widget_attribute.yaml +50 -0
  133. periplus/packs/drupal_basic@0.3.0/form/form_id.yaml +80 -0
  134. periplus/packs/drupal_basic@0.3.0/hook/hook.yaml +100 -0
  135. periplus/packs/drupal_basic@0.3.0/hook/hook_attribute.yaml +64 -0
  136. periplus/packs/drupal_basic@0.3.0/hook/hook_theme_include.yaml +34 -0
  137. periplus/packs/drupal_basic@0.3.0/library/library.yaml +12 -0
  138. periplus/packs/drupal_basic@0.3.0/library/library_definition.yaml +58 -0
  139. periplus/packs/drupal_basic@0.3.0/local_action/local_action.yaml +12 -0
  140. periplus/packs/drupal_basic@0.3.0/local_action/local_action_definition.yaml +49 -0
  141. periplus/packs/drupal_basic@0.3.0/mail/mail.yaml +8 -0
  142. periplus/packs/drupal_basic@0.3.0/mail/mail_attribute.yaml +43 -0
  143. periplus/packs/drupal_basic@0.3.0/media_source/media_source.yaml +8 -0
  144. periplus/packs/drupal_basic@0.3.0/media_source/media_source_annotation.yaml +43 -0
  145. periplus/packs/drupal_basic@0.3.0/media_source/media_source_attribute.yaml +79 -0
  146. periplus/packs/drupal_basic@0.3.0/menu_link/menu_link.yaml +18 -0
  147. periplus/packs/drupal_basic@0.3.0/menu_link/menu_link_definition.yaml +48 -0
  148. periplus/packs/drupal_basic@0.3.0/module/module.yaml +7 -0
  149. periplus/packs/drupal_basic@0.3.0/module/module_info.yaml +58 -0
  150. periplus/packs/drupal_basic@0.3.0/pack.yaml +528 -0
  151. periplus/packs/drupal_basic@0.3.0/permission/permission.yaml +7 -0
  152. periplus/packs/drupal_basic@0.3.0/permission/permission_definition.yaml +27 -0
  153. periplus/packs/drupal_basic@0.3.0/queue_worker/queue_worker.yaml +9 -0
  154. periplus/packs/drupal_basic@0.3.0/queue_worker/queue_worker_annotation.yaml +43 -0
  155. periplus/packs/drupal_basic@0.3.0/queue_worker/queue_worker_attribute.yaml +43 -0
  156. periplus/packs/drupal_basic@0.3.0/rest_resource/rest_resource.yaml +8 -0
  157. periplus/packs/drupal_basic@0.3.0/rest_resource/rest_resource_annotation.yaml +43 -0
  158. periplus/packs/drupal_basic@0.3.0/rest_resource/rest_resource_attribute.yaml +43 -0
  159. periplus/packs/drupal_basic@0.3.0/role/role.yaml +14 -0
  160. periplus/packs/drupal_basic@0.3.0/role/role_config.yaml +44 -0
  161. periplus/packs/drupal_basic@0.3.0/route/route.yaml +42 -0
  162. periplus/packs/drupal_basic@0.3.0/route/route_definition.yaml +113 -0
  163. periplus/packs/drupal_basic@0.3.0/route/route_options.yaml +55 -0
  164. periplus/packs/drupal_basic@0.3.0/route/route_requirements.yaml +108 -0
  165. periplus/packs/drupal_basic@0.3.0/service/service.yaml +56 -0
  166. periplus/packs/drupal_basic@0.3.0/service/service_definition.yaml +181 -0
  167. periplus/packs/drupal_basic@0.3.0/template/template.yaml +86 -0
  168. periplus/packs/drupal_basic@0.3.0/template/template_route_link.yaml +30 -0
  169. periplus/packs/drupal_basic@0.3.0/theme/theme.yaml +15 -0
  170. periplus/packs/drupal_basic@0.3.0/theme/theme_info.yaml +61 -0
  171. periplus/packs/drupal_basic@0.3.0/theme_hook/template_suggestion.yaml +29 -0
  172. periplus/packs/drupal_basic@0.3.0/theme_hook/theme_hook.yaml +87 -0
  173. periplus/packs/drupal_basic@0.3.0/theme_hook/theme_hook_render.yaml +20 -0
  174. periplus/packs/drupal_basic@0.3.0/url/url.yaml +88 -0
  175. periplus/packs/drupal_basic@0.3.0/views_plugin/views_field_attribute.yaml +80 -0
  176. periplus/packs/drupal_basic@0.3.0/views_plugin/views_filter_attribute.yaml +80 -0
  177. periplus/packs/drupal_basic@0.3.0/views_plugin/views_plugin.yaml +15 -0
  178. periplus/packs/drupal_basic@0.3.0/views_plugin/views_style_attribute.yaml +80 -0
  179. periplus/packs/drupal_js_basic@0.0.1/attachment/attachment.yaml +12 -0
  180. periplus/packs/drupal_js_basic@0.0.1/attachment/attachment_in_php.yaml +15 -0
  181. periplus/packs/drupal_js_basic@0.0.1/attachment/attachment_in_php_array.yaml +52 -0
  182. periplus/packs/drupal_js_basic@0.0.1/attachment/attachment_in_twig.yaml +26 -0
  183. periplus/packs/drupal_js_basic@0.0.1/attachment/php_function_holder.yaml +13 -0
  184. periplus/packs/drupal_js_basic@0.0.1/behavior/behavior.yaml +198 -0
  185. periplus/packs/drupal_js_basic@0.0.1/pack.yaml +153 -0
  186. periplus/packs/drupal_js_basic@0.0.1/setting/setting.yaml +13 -0
  187. periplus/packs/drupal_js_basic@0.0.1/setting/setting_in_js.yaml +15 -0
  188. periplus/packs/drupal_js_basic@0.0.1/setting/setting_in_php.yaml +92 -0
  189. periplus/packs/drush_basic@0.0.1/command/command.yaml +15 -0
  190. periplus/packs/drush_basic@0.0.1/command/command_annotation.yaml +60 -0
  191. periplus/packs/drush_basic@0.0.1/command/command_attribute.yaml +88 -0
  192. periplus/packs/drush_basic@0.0.1/pack.yaml +29 -0
  193. periplus/packs/eck_basic@0.0.1/bundle/eck_bundle_config.yaml +56 -0
  194. periplus/packs/eck_basic@0.0.1/entity_type/eck_entity_type_config.yaml +26 -0
  195. periplus/packs/eck_basic@0.0.1/pack.yaml +28 -0
  196. periplus/packs/go@0.0.2/interfaces/satisfies.yaml +47 -0
  197. periplus/packs/go@0.0.2/pack.yaml +51 -0
  198. periplus/packs/go@0.0.2/types/find_declarations.yaml +137 -0
  199. periplus/packs/go@0.0.2/types/node_types.yaml +36 -0
  200. periplus/packs/go_basic@0.0.3/pack.yaml +104 -0
  201. periplus/packs/go_basic@0.0.3/rules/calls.yaml +25 -0
  202. periplus/packs/go_basic@0.0.3/rules/declarations.yaml +40 -0
  203. periplus/packs/go_basic@0.0.3/rules/imports.yaml +16 -0
  204. periplus/packs/go_basic@0.0.3/types/node_types.yaml +15 -0
  205. periplus/packs/js_basic@0.0.1/function/function.yaml +68 -0
  206. periplus/packs/js_basic@0.0.1/pack.yaml +50 -0
  207. periplus/packs/laravel_basic@0.0.5/pack.yaml +313 -0
  208. periplus/packs/laravel_basic@0.0.5/rules/classes.yaml +42 -0
  209. periplus/packs/laravel_basic@0.0.5/rules/config.yaml +229 -0
  210. periplus/packs/laravel_basic@0.0.5/rules/routes.yaml +210 -0
  211. periplus/packs/laravel_basic@0.0.5/rules/types.yaml +50 -0
  212. periplus/packs/laravel_basic@0.0.5/rules/views.yaml +100 -0
  213. periplus/packs/paragraphs_basic@0.0.1/bundle/paragraph_bundle_config.yaml +54 -0
  214. periplus/packs/paragraphs_basic@0.0.1/pack.yaml +12 -0
  215. periplus/packs/php@0.1.0/edges/edge_kinds.yaml +64 -0
  216. periplus/packs/php@0.1.0/edges/find_calls.yaml +34 -0
  217. periplus/packs/php@0.1.0/edges/find_imports.yaml +18 -0
  218. periplus/packs/php@0.1.0/edges/find_member_access.yaml +22 -0
  219. periplus/packs/php@0.1.0/edges/find_structure.yaml +38 -0
  220. periplus/packs/php@0.1.0/embedded/embedded_regions.yaml +19 -0
  221. periplus/packs/php@0.1.0/imports/imports.yaml +20 -0
  222. periplus/packs/php@0.1.0/pack.yaml +117 -0
  223. periplus/packs/php@0.1.0/resolution/excluded_tokens.yaml +23 -0
  224. periplus/packs/php@0.1.0/resolution/resolution.yaml +35 -0
  225. periplus/packs/php@0.1.0/types/find_declarations.yaml +102 -0
  226. periplus/packs/php@0.1.0/types/node_types.yaml +55 -0
  227. periplus/packs/php_basic@0.2.0/edges/edge_kinds.yaml +48 -0
  228. periplus/packs/php_basic@0.2.0/edges/find_structure.yaml +750 -0
  229. periplus/packs/php_basic@0.2.0/imports/imports.yaml +19 -0
  230. periplus/packs/php_basic@0.2.0/pack.yaml +94 -0
  231. periplus/packs/php_basic@0.2.0/types/find_declarations.yaml +267 -0
  232. periplus/packs/php_basic@0.2.0/types/node_types.yaml +55 -0
  233. periplus/packs/profile_basic@0.0.1/bundle/profile_bundle_config.yaml +54 -0
  234. periplus/packs/profile_basic@0.0.1/pack.yaml +12 -0
  235. periplus/packs/salesforce_basic@0.0.1/event/salesforce_event.yaml +36 -0
  236. periplus/packs/salesforce_basic@0.0.1/pack.yaml +31 -0
  237. periplus/packs/salesforce_basic@0.0.1/salesforce_mapping/salesforce_mapping.yaml +19 -0
  238. periplus/packs/salesforce_basic@0.0.1/salesforce_mapping/salesforce_mapping_config.yaml +83 -0
  239. periplus/packs/salesforce_basic@0.0.1/salesforce_mapping_field/salesforce_mapping_field.yaml +8 -0
  240. periplus/packs/salesforce_basic@0.0.1/salesforce_mapping_field/salesforce_mapping_field_annotation.yaml +43 -0
  241. periplus/packs/twig@0.0.1/pack.yaml +26 -0
  242. periplus/packs/twig@0.0.1/types/template.yaml +57 -0
  243. periplus/packs/twig_basic@0.1.0/pack.yaml +11 -0
  244. periplus/packs/twig_tweak_basic@0.0.1/pack.yaml +27 -0
  245. periplus/packs/twig_tweak_basic@0.0.1/rules/block.yaml +20 -0
  246. periplus/packs/twig_tweak_basic@0.0.1/rules/entity.yaml +35 -0
  247. periplus/packs/twig_tweak_basic@0.0.1/rules/field.yaml +21 -0
  248. periplus/packs/twig_tweak_basic@0.0.1/rules/menu.yaml +21 -0
  249. periplus/packs/webform_basic@0.0.1/bundle/webform_submission_bundle_config.yaml +54 -0
  250. periplus/packs/webform_basic@0.0.1/pack.yaml +20 -0
  251. periplus/packs/webform_basic@0.0.1/webform_handler/webform_handler.yaml +8 -0
  252. periplus/packs/webform_basic@0.0.1/webform_handler/webform_handler_annotation.yaml +43 -0
  253. periplus/packs/yaml@0.0.1/pack.yaml +72 -0
  254. periplus/packs/yaml@0.0.1/types/find_mapping_entry.yaml +21 -0
  255. periplus/packs/yaml@0.0.1/types/yaml_types.yaml +44 -0
  256. periplus/packs/yaml_basic@0.1.0/pack.yaml +10 -0
  257. periplus/packs.py +447 -0
  258. periplus/preflight.py +102 -0
  259. periplus/py.typed +0 -0
  260. periplus/report.py +596 -0
  261. periplus/resolution.py +355 -0
  262. periplus/settings.py +617 -0
  263. periplus/settings.stub.yml +99 -0
  264. periplus/spec.py +774 -0
  265. periplus/update.py +197 -0
  266. periplus/validate.py +655 -0
  267. periplus_map-0.2.1.dist-info/METADATA +566 -0
  268. periplus_map-0.2.1.dist-info/RECORD +272 -0
  269. periplus_map-0.2.1.dist-info/WHEEL +4 -0
  270. periplus_map-0.2.1.dist-info/entry_points.txt +2 -0
  271. periplus_map-0.2.1.dist-info/licenses/LICENSE +202 -0
  272. periplus_map-0.2.1.dist-info/licenses/NOTICE +2 -0
@@ -0,0 +1,88 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # A Drush command declared by the Command attribute on a method, named by the argument name.
4
+ # Two rules because a rule that emits an edge emits no node, and two pairs because a match names
5
+ # one full class: Drush's attribute, and the Consolidation one it extends, which a command file may
6
+ # import instead.
7
+
8
+ rules:
9
+ - rule: command_from_attribute
10
+ reads: file
11
+ in:
12
+ - source
13
+ match:
14
+ attribute: Drush\Attributes\Command
15
+ filetype: php
16
+ where:
17
+ - applies_to: method_declaration
18
+ id:
19
+ from:
20
+ attribute_argument: name
21
+ must_be: string_literal
22
+ emits:
23
+ - node:
24
+ type: drush.command
25
+ confidence: declared
26
+ - rule: command_from_attribute_edges
27
+ reads: file
28
+ in:
29
+ - source
30
+ match:
31
+ attribute: Drush\Attributes\Command
32
+ filetype: php
33
+ where:
34
+ - applies_to: method_declaration
35
+ id:
36
+ from:
37
+ attribute_argument: name
38
+ must_be: string_literal
39
+ emits:
40
+ - edge:
41
+ kind: command_method
42
+ from: this_node
43
+ to: enclosing_method
44
+ - edge:
45
+ kind: command_class
46
+ from: this_node
47
+ to: enclosing_class
48
+ confidence: declared
49
+ - rule: command_from_consolidation_attribute
50
+ reads: file
51
+ in:
52
+ - source
53
+ match:
54
+ attribute: Consolidation\AnnotatedCommand\Attributes\Command
55
+ filetype: php
56
+ where:
57
+ - applies_to: method_declaration
58
+ id:
59
+ from:
60
+ attribute_argument: name
61
+ must_be: string_literal
62
+ emits:
63
+ - node:
64
+ type: drush.command
65
+ confidence: declared
66
+ - rule: command_from_consolidation_attribute_edges
67
+ reads: file
68
+ in:
69
+ - source
70
+ match:
71
+ attribute: Consolidation\AnnotatedCommand\Attributes\Command
72
+ filetype: php
73
+ where:
74
+ - applies_to: method_declaration
75
+ id:
76
+ from:
77
+ attribute_argument: name
78
+ must_be: string_literal
79
+ emits:
80
+ - edge:
81
+ kind: command_method
82
+ from: this_node
83
+ to: enclosing_method
84
+ - edge:
85
+ kind: command_class
86
+ from: this_node
87
+ to: enclosing_class
88
+ confidence: declared
@@ -0,0 +1,29 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-manifest.schema.json"
2
+
3
+ # Drush commands in the custom modules: each command, named by its name, as mymodule:sync, with
4
+ # a command_method edge to the method that runs it and a command_class edge to that method's
5
+ # class. A command is read from the Command attribute on a method, #[CLI\Command(name: '...')],
6
+ # and from the @command tag in a method's docblock. A method that carries both is one node with
7
+ # two locations, and its edges are found twice.
8
+ #
9
+ # Known gaps:
10
+ # - The @command tag is read as text, because the engine reads a docblock annotation only in the
11
+ # form @Name(...). The engine allows one file type read as text per ending, so the tag is read
12
+ # through drupal_basic's drupal_php_text, inside its block_comment section. Its class is named from the file's path by Drupal's PSR-4 layout:
13
+ # <module>/src/A/B.php is Drupal\<module>\A\B. So its edges are inferred, and a file whose class
14
+ # is named otherwise gives edges to a method and a class that do not exist, as unresolved nodes.
15
+ # A tag outside a file below a src folder makes a node and no edge.
16
+ # - The tag's method is the first function after the docblock's end, past one-line attributes
17
+ # and modifiers. An attribute split over lines between the docblock and the function makes the
18
+ # node and no edge. A tag inside a PHP string still makes a command.
19
+ # - An attribute whose name is not the named argument name:, such as #[CLI\Command('x')], or is
20
+ # not a text literal, makes nothing and is listed under skipped.
21
+ # - Aliases give nothing: the engine reads no item of an attribute's list argument, and the
22
+ # @aliases tag would need one rule per position in its list.
23
+ # - Options, arguments, usages, hooks (#[CLI\Hook], @hook), topics and validators give nothing.
24
+ # - A command class that is a service in a drush.services.yml file is mapped by drupal_basic as
25
+ # a service with its class; nothing joins that service to the command.
26
+ pack: drush_basic
27
+ version: 0.0.1
28
+ depends: [drupal_basic, php_basic]
29
+
@@ -0,0 +1,56 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # An ECK bundle read from its config file eck.eck_type.<entity type>.<bundle> as the bundle
4
+ # <entity type>.<bundle>, the id drupal_basic gives a field or display of it. The file names its
5
+ # entity type only in its name, so both edges read it from the path value
6
+ # eck_entity_type.
7
+
8
+ rules:
9
+ - rule: bundle_eck_from_config
10
+ reads: file
11
+ in:
12
+ - config
13
+ - module_config
14
+ match:
15
+ file: eck.eck_type.*
16
+ filetype: yml
17
+ id:
18
+ from: file_stem
19
+ normalize:
20
+ - {replace: '^eck\.eck_type\.', with: ''}
21
+ emits:
22
+ - node:
23
+ type: drupal.bundle
24
+ - attribute:
25
+ name: label
26
+ from:
27
+ key: name
28
+ confidence: declared
29
+ - rule: bundle_eck_from_config_edges
30
+ reads: file
31
+ in:
32
+ - config
33
+ - module_config
34
+ match:
35
+ file: eck.eck_type.*
36
+ filetype: yml
37
+ id:
38
+ from: file_stem
39
+ normalize:
40
+ - {replace: '^eck\.eck_type\.', with: ''}
41
+ emits:
42
+ - edge:
43
+ kind: configured_by
44
+ from: this_node
45
+ to:
46
+ from:
47
+ key: type
48
+ template: 'eck.eck_type.{eck_entity_type}.{type}'
49
+ - edge:
50
+ kind: bundle_of
51
+ from: this_node
52
+ to:
53
+ from:
54
+ key: type
55
+ template: '{eck_entity_type}'
56
+ confidence: declared
@@ -0,0 +1,26 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # An ECK entity type read from its config file: a content entity type named by its id, with its
4
+ # label. ECK defines no class for it, so it has no entity_class edge.
5
+
6
+ rules:
7
+ - rule: eck_entity_type_from_config
8
+ reads: file
9
+ in:
10
+ - config
11
+ - module_config
12
+ match:
13
+ file: eck.eck_entity_type.*
14
+ filetype: yaml
15
+ id:
16
+ from: file_stem
17
+ normalize:
18
+ - {replace: '^eck\.eck_entity_type\.', with: ''}
19
+ emits:
20
+ - node:
21
+ type: drupal.content_entity_type
22
+ - attribute:
23
+ name: label
24
+ from:
25
+ key: label
26
+ confidence: declared
@@ -0,0 +1,28 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-manifest.schema.json"
2
+
3
+ # The Entity Construction Kit contributed module: each ECK entity type, from its config file, as
4
+ # a content entity type with its label; and each ECK bundle, from its config file
5
+ # eck.eck_type.<entity type>.<bundle>, as the bundle <entity type>.<bundle> with its label (key
6
+ # name), a configured_by edge to that file and a bundle_of edge to its entity type.
7
+ #
8
+ # Known gaps: an ECK entity type's base field switches (uid, created, changed, title) and
9
+ # standalone_url give nothing, and it has no entity_class edge, because ECK defines no class per
10
+ # type. The bundle_of edge reads the entity type from the file name, not from a key, so a file
11
+ # renamed by hand gives a wrong edge. A bundle's description gives nothing.
12
+ #
13
+ # The path value eck_entity_type is declared on yaml_basic's type yml, so the bundle rules match
14
+ # filetype yml; a type of another name that claims the ending yml is refused.
15
+ pack: eck_basic
16
+ version: 0.0.1
17
+ depends: [drupal_basic]
18
+ files:
19
+ types:
20
+ # A bundle file names its entity type only in its file name, eck.eck_type.<entity type>.<bundle>.
21
+ yml:
22
+ endings: [yml]
23
+ reader: data
24
+ format: yaml
25
+ path_values:
26
+ eck_entity_type:
27
+ pattern: '^(?:.*/)?eck\.eck_type\.(?<name>[^./]+)\.[^/]+\.yml$'
28
+ template: '{name}'
@@ -0,0 +1,47 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # go pack — implicit interface satisfaction. Two map rules.
4
+ #
5
+ # The case the two-bucket split was designed for. A Go type satisfies an interface by having
6
+ # the right methods, says so nowhere, and the methods may sit in any file of the package. No
7
+ # rule that reads one file can answer it.
8
+
9
+ needs:
10
+ types:
11
+ - go.struct
12
+ - go.interface
13
+ edge_kinds:
14
+ - kind: has_receiver
15
+ from: go.method
16
+ to:
17
+ - go.struct
18
+ - go.interface
19
+ - kind: satisfies
20
+ from: go.struct
21
+ to: go.interface
22
+ rules:
23
+ - rule: collect_method_set
24
+ reads: map
25
+ match:
26
+ node_type: go.struct
27
+ where:
28
+ - has_incoming_edge: has_receiver
29
+ emits:
30
+ - attribute:
31
+ name: method_set
32
+ from:
33
+ incoming_edges: has_receiver
34
+ value: signature
35
+ confidence: declared
36
+ - rule: satisfies_interface
37
+ reads: map
38
+ match:
39
+ node_type: go.struct
40
+ where:
41
+ - method_set_covers: go.interface
42
+ emits:
43
+ - edge:
44
+ kind: satisfies
45
+ from: this_node
46
+ to: matched_node
47
+ confidence: declared
@@ -0,0 +1,51 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-manifest.schema.json"
2
+
3
+ # go pack — SKETCH in the rule format.
4
+ #
5
+ # Converted as the test of whether the format written against PHP, YAML and Drupal holds for
6
+ # a language that behaves differently in three ways: it declares no type relationships, it
7
+ # takes part of every id from a file at the repository root, and it joins id parts with two
8
+ # different separators in fixed positions.
9
+
10
+ pack: go
11
+ version: 0.0.2
12
+ depends: []
13
+
14
+ grammar:
15
+ provider: tree-sitter
16
+ provider_version: "0.26.13"
17
+ language: go
18
+ grammar_version: "0.23.4"
19
+ # UNVERIFIED: both numbers are placeholders in the shape the other packs use. Neither has
20
+ # been checked against a published release. Note also that tree-sitter's maintainers say
21
+ # to pin to a commit rather than a version, which no pack here does yet.
22
+
23
+ folders:
24
+ source: ./
25
+
26
+ files:
27
+ extensions: [go]
28
+ exclude: []
29
+
30
+ identity:
31
+ qualified_name:
32
+ parts:
33
+ - from: manifest
34
+ file: go.mod
35
+ match: '^module\s+(\S+)'
36
+ as: module_path
37
+ - from: path
38
+ relative_to: manifest_dir
39
+ strip: filename
40
+ as: package_dir
41
+ - from: declared_name
42
+ join:
43
+ - between: [module_path, package_dir]
44
+ with: "/"
45
+ - between: [package_dir, declared_name]
46
+ with: "."
47
+ # Two separators in fixed positions, and a part that comes from neither the file being
48
+ # classified nor the pack: `module_path` is one line in go.mod at the repository root.
49
+ # A PHP file writes its own namespace; a Go file does not.
50
+ case_folding:
51
+ sensitive: [all]
@@ -0,0 +1,137 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # go pack — finds the declarations. Five rules.
4
+ #
5
+ # Two of them match the same grammar node and are told apart by a child, which is the
6
+ # `has_child` condition doing what `body_child` does for PHP.
7
+
8
+ needs:
9
+ types:
10
+ - go.package
11
+ - go.func
12
+ - go.method
13
+ - go.struct
14
+ - go.interface
15
+ rules:
16
+ - rule: find_package
17
+ reads: file
18
+ in:
19
+ - source
20
+ match:
21
+ declaration: package_clause
22
+ name_child: package_identifier
23
+ id:
24
+ from: qualified_name
25
+ emits:
26
+ - node:
27
+ type: go.package
28
+ confidence: declared
29
+ - rule: find_func
30
+ reads: file
31
+ in:
32
+ - source
33
+ match:
34
+ declaration: function_declaration
35
+ name_child: identifier
36
+ id:
37
+ from: qualified_name
38
+ emits:
39
+ - node:
40
+ type: go.func
41
+ confidence: declared
42
+ - rule: find_struct
43
+ reads: file
44
+ in:
45
+ - source
46
+ match:
47
+ declaration: type_spec
48
+ name_child: type_identifier
49
+ where:
50
+ - has_child: struct_type
51
+ id:
52
+ from: qualified_name
53
+ emits:
54
+ - node:
55
+ type: go.struct
56
+ confidence: declared
57
+ - rule: find_interface
58
+ reads: file
59
+ in:
60
+ - source
61
+ match:
62
+ declaration: type_spec
63
+ name_child: type_identifier
64
+ where:
65
+ - has_child: interface_type
66
+ id:
67
+ from: qualified_name
68
+ emits:
69
+ - node:
70
+ type: go.interface
71
+ - attribute:
72
+ name: method_set
73
+ from:
74
+ text: true
75
+ pattern: (?s)interface\s*\{(?P<body>.*?)\}
76
+ normalize:
77
+ - replace: interface\{\}
78
+ with: any
79
+ - replace: \n
80
+ with: ;
81
+ - replace: '[ \t]+'
82
+ with: ' '
83
+ confidence: declared
84
+ - rule: find_method
85
+ reads: file
86
+ in:
87
+ - source
88
+ match:
89
+ declaration: method_declaration
90
+ name_child: field_identifier
91
+ id: &id001
92
+ from:
93
+ - module_path
94
+ - package_dir
95
+ - receiver_type
96
+ - declared_name
97
+ template: '{module_path}/{package_dir}.{receiver_type}.{declared_name}'
98
+ emits:
99
+ - node:
100
+ type: go.method
101
+ confidence: declared
102
+ - rule: exported_by_capitalisation
103
+ reads: file
104
+ in:
105
+ - source
106
+ match:
107
+ declaration: identifier
108
+ where:
109
+ - name_matches: ^[A-Z]
110
+ emits:
111
+ - role: go.exported
112
+ confidence: declared
113
+ - rule: find_method_edges
114
+ reads: file
115
+ in:
116
+ - source
117
+ match:
118
+ declaration: method_declaration
119
+ name_child: field_identifier
120
+ emits:
121
+ - edge:
122
+ kind: has_receiver
123
+ from: this_node
124
+ to:
125
+ from:
126
+ qualified: receiver_type
127
+ attributes:
128
+ signature:
129
+ from: text
130
+ pattern: func\s*\([^)]*\)\s*(?P<sig>\w+\s*\([^{]*)
131
+ normalize:
132
+ - replace: interface\{\}
133
+ with: any
134
+ - replace: \s+
135
+ with: ' '
136
+ confidence: declared
137
+ id: *id001
@@ -0,0 +1,36 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ # go pack — the node types. Finding them is in types/find_declarations.yaml.
4
+ #
5
+ # The abstractions are here because a finder needs them, and their absence was invisible
6
+ # until one was asked for. A map whose types are all siblings cannot answer "every callable
7
+ # here" — the query has nothing to descend. php declared php.callable from the start; this
8
+ # sketch did not, and nothing complained until the map was queried.
9
+
10
+ node_types:
11
+
12
+ - name: go.package
13
+ container: true
14
+
15
+ - name: go.callable
16
+ abstract: true
17
+
18
+ - name: go.func
19
+ parent: go.callable
20
+
21
+ - name: go.method
22
+ parent: go.callable
23
+
24
+ - name: go.type
25
+ abstract: true
26
+
27
+ - name: go.struct
28
+ parent: go.type
29
+ container: true
30
+
31
+ - name: go.interface
32
+ parent: go.type
33
+
34
+ roles:
35
+
36
+ - name: go.exported
@@ -0,0 +1,104 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-manifest.schema.json"
2
+
3
+ # Known gaps. The basic Go pack maps every package-level function, every method under its
4
+ # receiver type, and every struct and interface, each under its package's import path. It maps a
5
+ # call written f(x) to the function, struct or interface of that name in the caller's package,
6
+ # and pkg.F(x) to F under the import path pkg binds. A call into a package outside the project,
7
+ # fmt.Println() or cobra.Execute() after "github.com/spf13/cobra/v2", is an unresolved function
8
+ # named by the import path and the function: fmt.Println, github.com/spf13/cobra/v2.Execute.
9
+ # What it does not map, today:
10
+ # - A method call on a value, s.Serve(), makes no edge: s is bound by no import, so no step holds
11
+ # and the call is listed under skipped. A chained call, s.Self().Serve(), is skipped as not a
12
+ # written name; its inner call is a call of its own.
13
+ # - A method expression, util.T.M(t), is an unresolved function example.com/app/util.T.M, beside
14
+ # the mapped method of that name, with no edge to the method.
15
+ # - A generic call with type arguments, util.G[int](1), makes no edge and is not listed as skipped.
16
+ # - A call in a package-level initialiser, var early = util.Make(), makes no edge: it is listed
17
+ # under skipped, as no enclosing declaration is mapped.
18
+ # - An import binds its alias, else the last segment of its path less a trailing /vN, N 2 or more,
19
+ # or .vN: "gopkg.in/yaml.v3" binds yaml, "k8s.io/api/core/v1" binds v1. A package whose name
20
+ # differs, package other in folder naming, needs an alias: other.Thing() without one is
21
+ # skipped, and no edge reaches the mapped Thing.
22
+ # - A blank or a dot import binds nothing: after . "unicode", unicode.IsUpper() is skipped as no
23
+ # step holds. A bare call of a name a dot import brings in, ToUpper(s), shows as an unresolved
24
+ # <package>.ToUpper in the caller's package.
25
+ # - A local variable named like an imported package gives a false end: after
26
+ # url, err := url.Parse(s), url.String() is a calls edge to the unresolved net/url.String.
27
+ # - A method call on a package-level variable gives a false unresolved function: os.Stdout.Fd()
28
+ # ends at os.Stdout.Fd, pflag.CommandLine.Parse() at github.com/spf13/pflag.CommandLine.Parse,
29
+ # not at a method of the variable's type.
30
+ # - An edge's occurrences counts lines: two calls of one target on one line count once.
31
+ # - A call of a local function variable or parameter, fn(), shows as a call of <package>.fn. It
32
+ # is unresolved, unless the package declares fn: then the edge lands on that declaration, falsely.
33
+ # - A conversion to a named non-struct type, byName(x), also shows as an unresolved function.
34
+ # - A call of a project function named like a Go builtin or predeclared type, such as min, max or
35
+ # len, makes no edge. Those names are skipped before any lookup.
36
+ # - A type declared inside a function gets a package-level id, as if declared at the top. Two
37
+ # functions that each declare a type T give one node T holding both locations.
38
+ # - Build constraints are not read, so every platform file is mapped. Plat declared in a_linux.go
39
+ # and a_windows.go of one package is one node holding both locations, with no problem reported.
40
+ # - Test files (*_test.go) are not read, nor folders named testdata or vendor. So vendored
41
+ # dependencies are not mapped.
42
+ # - A folder or a .go file whose name starts with _ or a dot is not read. Go still builds such a
43
+ # folder when another package imports it by path, so a call into it, hid.Secret() after
44
+ # hid "example.com/app/_hidden", ends at an unresolved example.com/app/_hidden.Secret.
45
+ # - A nested module, a folder with its own go.mod, is mapped under the outer module as
46
+ # <module>/<folder>, which is not its real import path.
47
+ # The module path is not read from go.mod. Give it in the project settings as values.module, such
48
+ # as module: github.com/spf13/cobra, and run periplus at the module's root. Without it, periplus
49
+ # map exits 19 and writes no map, with "the template {module}/{file}, which names module, no
50
+ # capture of its pattern and no settings value". If the module sits in
51
+ # a subfolder of the project, that folder's name becomes part of every package path: name the
52
+ # folder as the module path's last segment and set values.module to the path without it, or move
53
+ # the settings to the module's root.
54
+ # The grammar is the optional extra go. Without it, periplus map exits 28 with "pins
55
+ # tree-sitter-go 0.25.0, and the version found is none"; install periplus-map[go].
56
+ pack: go_basic
57
+ version: 0.0.3
58
+ depends: []
59
+ grammar:
60
+ provider: tree-sitter
61
+ provider_version: "0.26.0"
62
+ language: go
63
+ grammar_version: "0.25.0"
64
+ # The whole project at any depth. The project root is the Go module's root.
65
+ folders:
66
+ source: ./**
67
+ files:
68
+ # A _test.go file is test code, often a second package, a testdata folder holds fixtures, a
69
+ # vendor folder holds dependencies. The go tool ignores a .go file whose name starts with _ or
70
+ # a dot, and ./... skips such a folder, though Go builds one a package imports by path.
71
+ exclude: ['**/*_test.go', '**/testdata/**', '**/vendor/**', '**/_*/**', '**/.*/**', '**/_*.go', '**/.*.go']
72
+ types:
73
+ go:
74
+ endings: [go]
75
+ reader: tree
76
+ path_values:
77
+ # The import path of a file's package: the module path from the settings, then the
78
+ # file's folder below the module root. main.go is <module>, doc/md_docs.go <module>/doc.
79
+ pkg:
80
+ pattern: '^(?<file>.+)$'
81
+ template: '{module}/{file}'
82
+ normalize:
83
+ - {replace: '/[^/]+$', with: ''}
84
+ identity:
85
+ # A full name is the package's import path, a dot, and the declared name.
86
+ qualified_name:
87
+ parts: [namespace, declared_name]
88
+ separator: "."
89
+ namespace:
90
+ path_value: pkg
91
+ # A call's name is written when it is an identifier, f(), or a selector of identifiers,
92
+ # x.f(). interpreted_string_literal_content is an import's path.
93
+ written_names: [identifier, selector_expression, field_identifier, interpreted_string_literal_content]
94
+ # f() is in the file's own package, even when f is also an import's bound name: in Go a bare
95
+ # name in a call is never a package. x.f() takes the import path x binds. A dotted name whose
96
+ # first segment no import binds, as a method on a value, has no step that holds.
97
+ resolve:
98
+ - prefix_bare_with: namespace
99
+ - bound_first_segment
100
+ # A call's arguments are the named children of its arguments field, by position. Its text
101
+ # literals are an interpreted and a raw string, each with its own node of text.
102
+ call_arguments: arguments
103
+ call_literals: [interpreted_string_literal, raw_string_literal]
104
+ call_literal_content: [interpreted_string_literal_content, raw_string_literal_content]
@@ -0,0 +1,25 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ rules:
4
+ # f(x) in a function or method: an edge to <package>.f; pkg.F(x): to <import path>.F, through the
5
+ # grammar's resolve. The end gives no resolve of its own, since its steps would run again on the
6
+ # resolved name. whole_written skips a chained call, a.B().C(). Builtins and predeclared
7
+ # conversions make nothing.
8
+ - rule: calls
9
+ reads: file
10
+ in: [source]
11
+ match:
12
+ reference: call_expression
13
+ name_child: function
14
+ filetype: go
15
+ whole_written: true
16
+ skip_names: [append, cap, clear, close, complex, copy, delete, imag, len, make, max, min, new,
17
+ panic, print, println, real, recover, any, bool, byte, comparable, complex64, complex128,
18
+ error, float32, float64, int, int8, int16, int32, int64, rune, string, uint, uint8, uint16,
19
+ uint32, uint64, uintptr]
20
+ emits:
21
+ - edge:
22
+ kind: calls
23
+ from: enclosing_declaration
24
+ to: {types: [go.function, go.struct, go.interface], on_miss: unresolved}
25
+ confidence: declared
@@ -0,0 +1,40 @@
1
+ $schema: "https://periplus.dev/schema/0/pack-file.schema.json"
2
+
3
+ rules:
4
+ # func Name(...): <package import path>.Name
5
+ - rule: function
6
+ reads: file
7
+ in: [source]
8
+ match: {declaration: function_declaration, name_child: name, filetype: go}
9
+ id: {from: qualified_name}
10
+ emits: [{node: {type: go.function}}]
11
+ confidence: declared
12
+ # func (c *Command) Name(...): <package>.Command.Name. The receiver field is the whole
13
+ # parenthesised list; normalize drops the variable, the star and any type parameters.
14
+ - rule: method
15
+ reads: file
16
+ in: [source]
17
+ match: {declaration: method_declaration, name_child: name, filetype: go}
18
+ id:
19
+ from: [pkg, receiver, declared_name]
20
+ template: '{pkg}.{receiver}.{declared_name}'
21
+ normalize:
22
+ - {replace: '\(\s*(?:\w+\s+)?\*?\s*', with: ''}
23
+ - {replace: '(?:\[[^\]]*\])?\s*\)', with: ''}
24
+ emits: [{node: {type: go.method}}]
25
+ confidence: declared
26
+ # type T struct{...} and type T interface{...} are both type_spec; the child type tells them apart.
27
+ - rule: struct
28
+ reads: file
29
+ in: [source]
30
+ match: {declaration: type_spec, name_child: name, filetype: go, where: [{has_child: struct_type}]}
31
+ id: {from: qualified_name}
32
+ emits: [{node: {type: go.struct}}]
33
+ confidence: declared
34
+ - rule: interface
35
+ reads: file
36
+ in: [source]
37
+ match: {declaration: type_spec, name_child: name, filetype: go, where: [{has_child: interface_type}]}
38
+ id: {from: qualified_name}
39
+ emits: [{node: {type: go.interface}}]
40
+ confidence: declared