Hi Ravi. Quick code review for a feature suggestion that you made a while back. It's in the orphaned_pyc branch of my repository...
I sort of implemented this.
Won't be able to checkout the code until next week, since I'm travelling and without a dev machine. So, you should merge it if you think it's good. What do you think about just printing a message listing the ghost pyc files instead of deleting them? I realized it might not be 'cool' for the tests script to delete files on the disk. Also, since check_spaces it doing so much that isn't just checking spaces, you could call it lint.
What do you think about just printing a message listing the ghost pyc files instead of deleting them?
Hmmm, I can't think of any use case where the tester wouldn't want the orphaned pyc to be deleted. Can you?
One thing that I dislike a little bit about this change is that we now have two static analysis tasks: pyc cleanup and whitespace checking. Ideally they'd both be in the same section, but...
the pyc cleanup needs to come before the tests since otherwise we'll use those orphaned pycs in tests
the whitespace checking needs to come after the tests since otherwise the other testing output will drown it out
Oh well, guess having both pre-testing and post-testing steps isn't the end of the world.
A more concerning gotcha is that even with this change we might still test against orphaned pyc files since the test_runner.py has numerous imports before we clean them up. If any of those imports leads to an orphaned pyc then it'll be in memory anyway.
I'm gonna push this for now. Improvements welcome!
Trac: Resolution: N/Ato implemented Status: needs_review to closed