Closed matt-garman closed 8 years ago
:+1: Thank you for implementing this so quickly! My only nitpick before merge is that I'd like you to add a test for the new feature. To do this, just add some ignores to https://github.com/mythmon/wok/blob/master/test_site/config using your new syntax, and also commit a file into the test site which will be ignored by the rule.
When you push the commit with the tests to the master branch of your fork of this repo, it'll show up here in the PR.
I added the test cases, and updated the config file. Note I created the test to-be-ignored files in the format "filename.ext_ignore", because checking in vim tilde files just felt wrong. :)
I also made the suggested stylistic change. However, in wok/jinja.py, it is already doing like this:
import glob
# ...
glob.glob("whatever")
So I followed suit with fnmatch, and continue to use it explicitly as fnmatch.fnmatch().
Edit: I suppose it goes without saying, but please let me know if you guys think anything else needs tweaked. Thanks!
I created Issue #138, "Feature request - ignore pattern config item". I thought I'd take a stab at implementing this. These changes represent "works for me" status. :) The idea is a new config parameter is introduced, "ignore_files", which is a list. By default, this list is empty, which retains original behavior. But in my case, I put this in my config file:
This, along with the corresponding code changes, allows Wok to ignore files that match that glob pattern. Those are backup files created by my editor (vim). Without this patch, I was basically doing a "find ./ -name "*~" -delete" before invoking Wok, else I would get this error for templates:
and this for content files:
This is my first time using GitHub for anything other than a simple clone, please go easy on me!