tophat / codewatch

[deprecated] Monitor and manage deeply customizable metrics about your python code using ASTs
https://codewatch.io
Apache License 2.0
38 stars 3 forks source link

directory_filter should receive full relative path #77

Closed lime-green closed 5 years ago

lime-green commented 5 years ago

Directory filter methods receive the folder name but should receive the full path, relative to the base directory

noahnu commented 5 years ago

@lime-green Changing the path supplied to the filter would be a breaking change.

Do we want to pass the dir path as a second argument to the filter function to preserve old behaviour, or just make the breaking change with the idea that the old behaviour is an unwanted "bug"? (Personally, I don't see the value of the current behaviour which doesn't include the full relative path. If anything it's misleading.)

lime-green commented 5 years ago

Yeah I think it’s better to resolve this as a breaking change, because like you said, it’s a troublesome bug

noahnu commented 5 years ago

Have a PR up to address this. Should this only apply to directory_filter, or file_filter as well? or perhaps file_filter should have a second parameter for directory so you can construct a rule that says "only process abc.py if it resides in alphabet directory" (or the reverse to make a blacklist).

noahnu commented 5 years ago

Fixed in #94