Skip to content

fix: ignore duplicate constants in versioned migrations - #691

Open
ApexWorm wants to merge 1 commit into
peteromallet:mainfrom
ApexWorm:fix/ignore-versioned-migration-duplicate-constants
Open

fix: ignore duplicate constants in versioned migrations#691
ApexWorm wants to merge 1 commit into
peteromallet:mainfrom
ApexWorm:fix/ignore-versioned-migration-duplicate-constants

Conversation

@ApexWorm

@ApexWorm ApexWorm commented Aug 1, 2026

Copy link
Copy Markdown

Problem

The Python duplicate-constant detector reports an identical SQL constraint when it appears in both an immutable versioned migration and the current runtime model. Centralizing that value would make the historical migration depend on runtime code.

Fix

Skip duplicate-constant collection only for conventional migrations/versions and alembic/versions paths, recognizing both path separators. Ordinary source-module detection remains unchanged.

Verification

  • python3 -m pytest -q -p no:cacheprovider desloppify/languages/python/tests/test_py_smells_crossfile.py desloppify/tests/lang/python/test_py_smells_ast_api_direct.py
  • ruff check desloppify/languages/python/detectors/smells_ast/_source_detectors.py desloppify/languages/python/tests/test_py_smells_crossfile.py
  • ruff format --check desloppify/languages/python/detectors/smells_ast/_source_detectors.py desloppify/languages/python/tests/test_py_smells_crossfile.py

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