jendrikseipp / vulture

Find dead Python code
MIT License
3.29k stars 145 forks source link

Remove files from AST tree #333

Open MartinBernstorff opened 9 months ago

MartinBernstorff commented 9 months ago

Thanks for an awesome tool! I have a use-case that I'm unsure if covered by the current implementation.

We're developing a python data-processing pipeline, consisting of a "library" and an "application" module.

Our test coverage is good so, technically, almost all of the library is not "dead". But I would like to know whether there are parts of the library which is not used in any part of the application, so I can remove it.

I tried specifying the --ignore flag, but it seems that it only ignores errors from the ignored files, it doesn't exclude them from the AST. Is this correct, and is there any way of excluding them from the AST?

RJ722 commented 8 months ago

The --exclude flag does what you're looking for. I'm assuming you mean --ignore-names or --ignore-decorators by ignore flag, which behave in the way you described.