Skip to content

Ignore node_modules directories by default - #905

Merged
lieryan merged 3 commits into
python-rope:masterfrom
marcoeangeli:fix/ignore-node-modules-by-default
Oct 24, 2026
Merged

lieryan merged 3 commits into
python-rope:masterfrom
marcoeangeli:fix/ignore-node-modules-by-default

Conversation

@marcoeangeli

@marcoeangeli marcoeangeli commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

Summary: Ignore node_modules directories by default so projects containing Python and JavaScript avoid scanning frontend dependencies during file enumeration and source-folder discovery.

I did not add any tests as I did not find existing tests for the other ignored directories + I think these changes are trivial. Happy to add some if needed though.

Motivation

This surfaced as an issue for me in Emacs: When Emacs/python-lsp/pylsp-rope checked what code actions were available, it entered Rope's source-folder scan, and (due to scanning the node_modules directory in my project) took a long time and blocked other LSP requests I made (such as going to definition for a symbol).

Adding node_modules to ignored_resources reduced code-action responses significantly, fixing the issue. I thought making the fix upstream would be good in case others run into similar issues.

Related discussion: #869 (comment).

Checklist

  • I have updated CHANGELOG.md
  • I have made corresponding changes to user documentation for new features

@marcoeangeli
marcoeangeli marked this pull request as ready for review October 17, 2026 15:50
@lieryan
lieryan enabled auto-merge October 24, 2026 06:11
@codecov

codecov Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.34%. Comparing base (22f5e50) to head (b8f46f1).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #905   +/-   ##
=======================================
  Coverage   95.34%   95.34%           
=======================================
  Files         134      134           
  Lines       26762    26762           
=======================================
  Hits        25516    25516           
  Misses       1246     1246           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lieryan
lieryan merged commit b4d32bc into python-rope:master Oct 24, 2026
30 checks passed
@lieryan

lieryan commented Oct 24, 2026

Copy link
Copy Markdown
Member

Thanks for contributing this PR, the change looks good to me.

@allcontributors please add @marcoeangeli for code contribution

@allcontributors

Copy link
Copy Markdown
Contributor

@lieryan

I've put up a pull request to add @marcoeangeli! 🎉

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.

2 participants