Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

add bool filter #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add bool filter #65

wants to merge 1 commit into from

Conversation

jmpesp
Copy link

@jmpesp jmpesp commented Oct 7, 2020

bool is a Python keyword and cannot be added as a --filter without infinite recursion

bool is a Python keyword and cannot be added as a --filter without infinite recursion
@@ -190,6 +190,7 @@ def render_command(cwd, environ, stdin, argv):
renderer.register_filters({
'docker_link': filters.docker_link,
'env': filters.env,
'bool': bool,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have toBool rather than bool?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 how about both bool and toBool? My application of j2cli is using it to format Ansible jinja, and my existing templates all use bool :)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say, bool is a builtin data type so in the future if we add more stuff around the same filter then it will be easier to handle the stuff with a diff name.

@@ -190,6 +190,7 @@ def render_command(cwd, environ, stdin, argv):
renderer.register_filters({
'docker_link': filters.docker_link,
'env': filters.env,
'bool': bool,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also update the docs/README with this PR?

You should update docs anytime you change code; especially when changing a public interface. This PR seems very low-effort.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants