Skip to content

feat(pre-commit): add internal-import alias check with auto-fix#49

Open
dengqiaoyu wants to merge 1 commit into
apple:mainfrom
dengqiaoyu:u/qiaoyu_deng/private-import-check
Open

feat(pre-commit): add internal-import alias check with auto-fix#49
dengqiaoyu wants to merge 1 commit into
apple:mainfrom
dengqiaoyu:u/qiaoyu_deng/private-import-check

Conversation

@dengqiaoyu

Copy link
Copy Markdown
Contributor
  • Add an AST-based hook enforcing code style guide §3.3: public modules must _-alias symbols imported from private modules; private modules must not
  • Auto-fix offending import statements and rename in-file references, refusing the fix only when the bound name is shadowed
  • Register the hook in .pre-commit-config.yaml and document it under §3.3 "Enforcement"
  • Apply across src/coreai_opt/, normalizing 27 modules with missing or redundant _ aliases

- Add an AST-based hook enforcing code style guide §3.3: public modules must `_`-alias symbols imported from private modules; private modules must not
- Auto-fix offending import statements and rename in-file references, refusing the fix only when the bound name is shadowed
- Register the hook in `.pre-commit-config.yaml` and document it under §3.3 "Enforcement"
- Apply across `src/coreai_opt/`, normalizing 27 modules with missing or redundant `_` aliases
@dengqiaoyu
dengqiaoyu requested review from crowbat and guru-desh July 20, 2026 19:16
@dengqiaoyu dengqiaoyu added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants