Skip to content

refactor(extract): move extract_terraform to extractors/terraform.py (verbatim)#1721

Open
Cekaru wants to merge 1 commit into
Graphify-Labs:v8from
Cekaru:refactor/extract-terraform
Open

refactor(extract): move extract_terraform to extractors/terraform.py (verbatim)#1721
Cekaru wants to merge 1 commit into
Graphify-Labs:v8from
Cekaru:refactor/extract-terraform

Conversation

@Cekaru

@Cekaru Cekaru commented Jul 7, 2026

Copy link
Copy Markdown

Part of the extract.py split tracked in #1212. Ports the Terraform/HCL extractor into its own per-language module.

What changed

  • Moved extract_terraform and its private _TF_META_HEADS constant verbatim into graphify/extractors/terraform.py.
  • extract.py keeps 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.
  • Registered in extractors/__init__.LANGUAGE_EXTRACTORS (alphabetical).
  • Added tests/test_extractors_registry.py with module-import / facade-identity / registry-identity checks.
  • Updated extractors/MIGRATION.md status table.

Behavior preservation

  • git diff --color-moved confirms the function + constant are byte-identical (verified locally with diff).
  • Net effect on extract.py: -178 lines, +1 import line — a pure move.
  • Helper classification: _TF_META_HEADS had 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.
  • No test edits outside the new registry test.

…(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.
@Cekaru Cekaru force-pushed the refactor/extract-terraform branch from e897e91 to 404b222 Compare July 7, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant