fix(core): consolidate DOC_EXTENSIONS copies and add drift guard (#1489) - #2159
Open
rishu685 wants to merge 1 commit into
Open
fix(core): consolidate DOC_EXTENSIONS copies and add drift guard (#1489)#2159rishu685 wants to merge 1 commit into
rishu685 wants to merge 1 commit into
Conversation
…owise-dev#1489) Closes repowise-dev#1489. - Point _DOC_SUFFIXES in categories.py to DOC_EXTENSIONS from support_paths - Point _DOC_EXT in fix_shape.py to DOC_EXTENSIONS from support_paths - Add AST-based architectural drift guard test in tests/unit/test_no_doc_extension_copies.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1489
Context
Two hand-written literal copies of the documentation extension set (
{".md", ".mdx", ".rst", ".txt", ".adoc"}) remained incategories.pyandfix_shape.py, with no architectural test in place to prevent future drift.Solution
_DOC_SUFFIXESinpackages/core/src/repowise/core/generation/categories.pytosupport_paths.DOC_EXTENSIONS._DOC_EXTinpackages/core/src/repowise/core/ingestion/git_indexer/fix_shape.pytosupport_paths.DOC_EXTENSIONS.tests/unit/test_no_doc_extension_copies.py(followingtest_no_test_path_copies.py) to inspect the AST acrosspackages/and prevent new hand-written doc-extension sets or constants from being introduced outsiderepowise.core.support_paths.categories._DOC_SUFFIXES,fix_shape._DOC_EXT, andknowledge_graph._DOC_EXTENSIONSall alias the exact sameDOC_EXTENSIONSobject.Verification