Closed natanlao closed 5 years ago
Thanks for your contribution @natanlao
We can actually simplify this quite a bit. From requirements perspective, we don't need to support multiple .treonignore
files, just one file at the base of test PATH specified to treon should suffice. What we actually need though is to be able to specify individual file paths to ignore e.g. run all tests except ignore this scratch notebook.
With these requirements in mind we can simply implement the following,
.treonignore
file (if present at base of test PATH)Edit: Updated my own suggestions.
From requirements perspective, we don't need to support multiple .treonignore files, just one file at the base of test PATH specified to treon should suffice.
I'm not sure that only looking for a single .treonignore
file would make this code materially simpler. I think that both approaches are similar in terms of both complexity and LOC. That said, I'm happy to change it if you still think it's a good idea.
What we actually need though is to be able to specify individual file paths to ignore e.g. run all tests except ignore this scratch notebook.
That works! https://github.com/ReviewNB/treon/blob/833ccded93ad561d0565c9728a682e780bb46f4b/tests/test_ignore.py#L30
@natanlao I'm sorry I haven't been able to find free time to review this properly. I want to clone your changes and try it out locally for a meaningful review. I will get to it early next week. Sorry again for the delay.
@amit1rrr All good! Thanks for your time.
Thanks for the review @amit1rrr! I've addressed your comments and added tests cases where appropriate.
I tried it again. Somehow the ignore list is still not working for me. Posted example in a separate comment.
I honestly think that this approach is getting too complicated in our quest to be identical as .gitignore
(which we don't need to be). How about we simply read a single .treonignore
file at base of the path
. And exclude that rule list from notebooks_to_test by simply comparing whether the notebook path starts with any rule (if yes, ignore).
Some benefits over current approach,
Okay! Sounds good to me.
Discarding this PR now that we have --exclude command line option.
Sorry, this got stuck on my backlog! Thanks for following up.
No worries @natanlao
Closes #1. Allows ignoring notebooks with a
.treonignore
file. It mimics how.gitignore
files work, except a little simpler.