-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Strict jinja environment #598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strict jinja environment #598
Conversation
💤 git on appveyor... |
Current coverage is
|
Epic bit of work here. Alas, looks like @appveyor timed out on git. :( |
Thanks brother! 🙇 Rebasing on #602 |
a13eaaa
to
8ca5d60
Compare
We can remove the xfail on one of the tests as soon as audreyfeldroy/cookiecutter-jquery#2 is merged 😄 cc @audreyr |
There we go 😹 |
@hackebrot this has proved useful because it showed me a bug in cookiecutter-django 🎉 the error output was this:
I was initially a little confused by the error text, condensed all on one line. said that, I do not know if it's good practice to put line break on |
@luzfcb: I usually don't put linebreaks in string literals as you don't really know what the actual display will be. I personally prefer to leave linewrapping to the terminal output which accounts for linewidth etc. However I completely understand your feedback...we could have a custom catch in ...
except (OutputDirExistsException,
InvalidModeException,
FailedHookException) as e:
click.echo(e)
sys.exit(1)
except UndefinedVariableInTemplate as e:
click.echo(e.message)
click.echo('Error message: {}'.format(e.error.message))
click.echo('Context: {}'.format(e.context))
sys.exit(1) |
@maiksensi: Cookiecutter implements |
@hackebrot nice idea.
http://click.pocoo.org/6/utils/#ansi-colors
...
except (OutputDirExistsException,
InvalidModeException,
FailedHookException) as e:
click.echo(e)
sys.exit(1)
except UndefinedVariableInTemplate as e:
click.echo(e.message)
# click.echo('Error message: {}'.format(e.error.message))
click.secho('Error message: {}'.format(e.error.message), fg='red')
click.echo('Context: {}'.format(e.context))
sys.exit(1) but, support the color output must be treated at another issue |
Update: Changed echo according to @luzfcb's feedback: Example error:
I have to say this is pretty dope 😹 |
(I does not support colored output) |
Any objections? |
great work here 👍 |
Great stuff! 👍 |
Reviewing cause this one is HUUUUUGE |
😹 |
Resolve #111
Resolve #586
Close #592