refactor: Modernize and optimize check_structure.py script - #7521
refactor: Modernize and optimize check_structure.py script#7521geniruphin-junior wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7521 +/- ##
============================================
- Coverage 80.25% 80.24% -0.01%
+ Complexity 7358 7357 -1
============================================
Files 810 810
Lines 23787 23787
Branches 4678 4678
============================================
- Hits 19091 19089 -2
Misses 3940 3940
- Partials 756 758 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
prashantpiyush1111
left a comment
There was a problem hiding this comment.
Nice refactor overall. One suggestion: could you keep the inline comments and docstrings in English for consistency with the rest of the repository? The implementation looks good, but using a single language throughout the codebase makes maintenance easier.
|
i agree with @prashantpiyush1111 |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution! |
Description
This Pull Request modernizes and optimizes the
check_structure.pyscript by leveraging modern Python 3.10+ practices, improving memory consumption, and enforcing clean code standards.Changes Made
main()function instead of running it raw under the__main__block._find_misplaced_java_filesto return anIterator(generator expression) instead of building a full list in memory, which scales better as the repository grows.java_file.parentsdirectly.any()for a cleaner and more idiomatic path validation logic.VALID_PATHS).sys.stderrinstead of standardstdout, and added clear visual feedback (❌/✅) with file counters for better logs readability.Checklist