refactor(extract): move extract_terraform to extractors/terraform.py (verbatim)#1721
refactor(extract): move extract_terraform to extractors/terraform.py (verbatim)#1721Cekaru wants to merge 1 commit into
Conversation
…(verbatim) Ports the Terraform/HCL extractor out of the 17k-line extract.py into its own per-language module, continuing the split tracked in Graphify-Labs#1212. - extract_terraform and its private _TF_META_HEADS constant moved verbatim (git diff --color-moved confirms byte-identity; the existing test_terraform.py suite passing is the behavior-preservation proof). - extract.py keeps the facade re-export so all existing importers are unchanged. - Registered in extractors/__init__.LANGUAGE_EXTRACTORS (alphabetical). - Added tests/test_extractors_registry.py with module/facade/registry identity checks; MIGRATION.md status table updated.
e897e91 to
404b222
Compare
…ge split (#1721) The extract_terraform move #1721 proposed already landed on v8 via the #1737 decomposition (extractors/terraform.py exists, extract.py re-exports it, and extractors/LANGUAGE_EXTRACTORS registers it), so the code move is a no-op now. But the regression test @Cekaru added with it had no equivalent on v8. Salvage and generalize it: sweep every LANGUAGE_EXTRACTORS entry and assert graphify. extract re-exports the SAME object (facade identity) and the registry maps to it (registry identity), plus the concrete terraform anchor from the PR. This institutionalizes the re-export-identity guarantee the split relies on, so a future move that forgets a facade re-export fails loudly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Thanks @Cekaru. The Terraform move itself already landed on The part that wasn't already covered is the regression test you added — there was no facade/registry-identity guard on Closing since the move is already in and the test is merged. Appreciate the clean, verified-move approach — exactly the right pattern for the split. |
Part of the
extract.pysplit tracked in #1212. Ports the Terraform/HCL extractor into its own per-language module.What changed
extract_terraformand its private_TF_META_HEADSconstant verbatim intographify/extractors/terraform.py.extract.pykeeps the facade re-export (from graphify.extractors.terraform import extract_terraform # noqa: F401), so every existing importer (__main__.py,watch.py, tests, etc.) is unchanged.extractors/__init__.LANGUAGE_EXTRACTORS(alphabetical).tests/test_extractors_registry.pywith module-import / facade-identity / registry-identity checks.extractors/MIGRATION.mdstatus table.Behavior preservation
git diff --color-movedconfirms the function + constant are byte-identical (verified locally withdiff).extract.py: -178 lines, +1 import line — a pure move._TF_META_HEADShad 0 remaining uses after the move → private → moved with the function (per MIGRATION.md).Tests
test_terraform.py(8) +test_extractors_registry.py(1) pass.test_extract.py(114) pass.