Skip to content

changed the hard coded version of walk to prune heavy directories like node_modules#90

Open
Ronit Sabhaya (Ronitsabhaya75) wants to merge 1 commit into
duolingo:masterfrom
Ronitsabhaya75:hardcoded-version
Open

changed the hard coded version of walk to prune heavy directories like node_modules#90
Ronit Sabhaya (Ronitsabhaya75) wants to merge 1 commit into
duolingo:masterfrom
Ronitsabhaya75:hardcoded-version

Conversation

@Ronitsabhaya75

Copy link
Copy Markdown

This PR introduces two related fixes to sync_ai_rules to improve hook execution speed and fix target directory resolution.

  1. Pruned os.walk Traversal: Modified the dirnames list in-place within _ensure_agents_skills_symlinks. Previously, the brute-force traversal would crawl heavy, irrelevant directories (e.g., .git, node_modules, .venv), causing unnecessary I/O overhead in large monorepos. It now explicitly skips these.

  2. Fixed Hardcoded Root Path: Updated the main() setup which previously hardcoded project_root = str(Path.cwd()). This caused the script to ignore the --target-dir CLI argument and evaluate the wrong directory context when triggered by the pre-commit framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant