Skip to content

Move tag type fallback definitions from tag_types.py to const.py#11

Merged
Misiu merged 2 commits intomainfrom
copilot/move-fallback-definitions-to-const
Feb 12, 2026
Merged

Move tag type fallback definitions from tag_types.py to const.py#11
Misiu merged 2 commits intomainfrom
copilot/move-fallback-definitions-to-const

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 12, 2026

An automated workflow updates fallback_definitions in tag_types.py weekly. Moving this 89-entry dictionary to const.py reduces risk by isolating data updates from business logic changes.

Changes

  • const.py: Added FALLBACK_TAG_DEFINITIONS (89 tag type entries)
  • tag_types.py: Import and reference constant instead of inline dictionary (649 lines, down from 740)
  • scripts/generate_tag_types.py: Target const.py, update regex pattern for FALLBACK_TAG_DEFINITIONS, adjust indentation from 12→4 spaces
  • tests/scripts/test_sync_tag_types.py: Update fixtures and assertions for new structure
  • .github/workflows/sync-tag-definitions.yml: Track const.py in automated PRs
# Before: Large inline dictionary in class method
def _load_fallback_types(self) -> None:
    fallback_definitions = {
        0: {"version": 4, "name": "M2 1.54\"", ...},
        # ... 88 more entries
    }
    self._tag_types = {...}

# After: Import from constants
from .const import FALLBACK_TAG_DEFINITIONS

def _load_fallback_types(self) -> None:
    self._tag_types = {
        type_id: TagType(type_id, data) 
        for type_id, data in FALLBACK_TAG_DEFINITIONS.items()
    }

Automated updates now modify a simple constants file rather than a module containing TagTypesManager business logic.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: Misiu <1741838+Misiu@users.noreply.github.com>
Copilot AI changed the title [WIP] Move fallback_definitions to const.py for better management Move tag type fallback definitions from tag_types.py to const.py Feb 12, 2026
Copilot AI requested a review from Misiu February 12, 2026 05:34
@Misiu Misiu marked this pull request as ready for review February 12, 2026 05:37
@Misiu Misiu merged commit e64eb09 into main Feb 12, 2026
3 checks passed
@Misiu Misiu deleted the copilot/move-fallback-definitions-to-const branch February 12, 2026 07:31
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