crabviz icon indicating copy to clipboard operation
crabviz copied to clipboard

🚀 Feature Request: Exclude Files Using .gitignore Doesn't Work

Open jdavis-software opened this issue 1 year ago • 1 comments

🐛 Bug Description

It seems that Crabviz is not respecting .gitignore rules when generating function call graphs. Specifically, I am trying to exclude all .spec.ts files from the analysis, but they still appear in the output.

🔄 Steps to Reproduce

  1. Add **/*.spec.ts to your .gitignore file.
  2. Run Crabviz to generate the call graph.
  3. Notice that .spec.ts files are still included in the output.

🎯 Expected Behavior

Crabviz should exclude any files that match patterns defined in .gitignore, or tsconfig preventing .spec.ts files (or any ignored files) from appearing in the call graph.

🛠️ Environment

  • Crabviz Version: 0.4.0
  • VS Code Version: 1.97.1
  • Operating System: Mac OSx Sequoia - Version 15.3.1 (24D70)

📝 Additional Context

  • I verified that my .gitignore rule is correct and that the files are properly ignored by Git.
  • If this feature was recently added, it may not be working as expected.

Would love to see this fixed! 🦀✨

Thanks for the great tool! 🚀🔥

jdavis-software avatar Mar 19 '25 05:03 jdavis-software

Sorry for the late reply. And thank you very much for this detailed bug report! I'll look into it, and try to fix it before next release.

As for the ignore config files, Crabviz currently just supports .gitignore files. There are many types of ignore config files of different formats, I think we shouldn't put too much effort in supporting those files.

chanhx avatar Apr 01 '25 08:04 chanhx

I've tested this, and Crabviz worked fine. I think it's because you modified the .gitignore file after you run Crabviz.

Crabviz caches ignoring rules after it reads the rules, so if you want the modifications work, just reload window after you modify ignoring rules. I don't want to change this, because modifying .gitignore is not a frequent behavior, I think we don't need to check if the .gitignore files are modified every time it generates a call graph.

chanhx avatar Aug 25 '25 03:08 chanhx