Skip to content

docs: add comment explaining _versionId leading underscore#30

Closed
moss-bryophyta wants to merge 1 commit intogeneraltranslation:mainfrom
moss-bryophyta:fix/version-id-key-comment
Closed

docs: add comment explaining _versionId leading underscore#30
moss-bryophyta wants to merge 1 commit intogeneraltranslation:mainfrom
moss-bryophyta:fix/version-id-key-comment

Conversation

@moss-bryophyta
Copy link
Copy Markdown
Contributor

@moss-bryophyta moss-bryophyta commented Mar 19, 2026

Adds a clarifying comment on the _versionId key in _KEY_MAP to explain the leading underscore is intentional and matches the gt.config.json convention for internal fields.

Addresses code review feedback.

Greptile Summary

This PR adds a single clarifying comment to the _versionId entry in _KEY_MAP inside _load_gt_config.py, explaining that the leading underscore is intentional and reflects the gt.config.json convention for marking internal fields. No functional code is changed.

  • Adds # leading underscore intentional — matches gt.config.json convention for internal fields comment to line 19.
  • No logic, types, or runtime behaviour are affected.

Confidence Score: 5/5

  • This PR is safe to merge — it is a documentation-only change with no impact on runtime behaviour.
  • The entire change is a single inline comment. No logic, control flow, types, or data transformations are modified, so there is zero risk of introducing a bug or regression.
  • No files require special attention.

Important Files Changed

Filename Overview
packages/gt-i18n/src/gt_i18n/internal/_load_gt_config.py Adds an inline comment to the _versionId key in _KEY_MAP clarifying that the leading underscore is intentional and mirrors the gt.config.json convention for internal fields. No logic changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["load_gt_config(config_path)"] --> B{config_path provided?}
    B -- No --> C[Try default gt.config.json]
    B -- Yes --> D[Open explicit path]
    C -- Not found --> E[Return empty GTConfig]
    C -- Found --> F[Read & parse JSON]
    D -- Not found --> G[Raise FileNotFoundError]
    D -- Found --> F
    F -- Invalid JSON --> H[Raise ValueError]
    F -- Valid object --> I["Iterate _KEY_MAP\n(camelCase → snake_case)"]
    I --> J["Map _versionId → version_id\n(leading _ is intentional\nfor internal fields)"]
    I --> K[Map other keys]
    J --> L[Return GTConfig]
    K --> L
Loading

Last reviewed commit: "docs: add comment ex..."

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.

2 participants