gauge-sh / tach

A Python tool to enforce dependencies, using modular architecture 🌎 Open source 🐍 Installable via pip πŸ”§ Able to be adopted incrementally - ⚑ Implemented with no runtime impact ♾️ Interoperable with your existing systems πŸ¦€ Written in rust
https://gauge.sh
MIT License
953 stars 33 forks source link

Filter dependencies in tach report #187

Closed nip3o closed 1 month ago

nip3o commented 1 month ago

I'm in the process of untangling the dependencies of a project, and trying to figure out why a certain module, say utils, depend on another module, say blog. The goal is to remove blog from the depends_on: list of utils.

The most helpful way I have found is to comment out blog from the depends_on: list of utils and then run tach check to get a list of modules that causes that dependency. This is a bit cumbersome though.

Would it be possible to add something like a --filter option to tach report to only show dependencies of a certain module (i.e. tach report utils --filter=blog) to achieve the same the same goal? Right now tach report lists every single dependency, including dependencies within the module itself, which is just too much output to be useful.

emdoyle commented 1 month ago

This makes sense, and your use case with commenting out a dependency is one I see all the time. This should be a straightforward addition! I can tackle this after #171