Skip to content
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

Ported customize/filters/tests functionality from j2cli #46

Merged
merged 8 commits into from
Feb 9, 2025

Conversation

mlasevich
Copy link

Like many others we have been affected by the j2cli's lack of maintenance. Looking around this seems to be the best candidate for a drop-in replacement - but to be a complete drop-in replacement it needs to have a compatible j2cli customization mechanism. This PR ports --customize, --filters, and --tests flags from j2cli along with fixed version of the code.

I know the preferred method would normally be via a plugin, however, since plugins currently cannot handle the cli args, i am opening a PR as it is the only way to add this. I did my best to minimize code changes to cli.py and move most of the ported code is in its own source code files.

I did not do any of the documentation nor cleanup, as before I spent too much time, I wanted to first see if this is acceptable in general.

Please let me know what you need to consider merging this.

Thanks!

@kpfleming
Copy link
Owner

This is a very reasonable approach, given that I'm not likely to ever have time to implement it in the way that I had planned to :-) Feel free to continue getting this into mergeable shape, and I'll keep an eye on it so it can be merged and released.

@mlasevich
Copy link
Author

This is a very reasonable approach, given that I'm not likely to ever have time to implement it in the way that I had planned to :-) Feel free to continue getting this into mergeable shape, and I'll keep an eye on it so it can be merged and released.

Ok, I am looking it closer and due to linter requirements, I may have to do some refactoring... I was doing my best to minimize changes to both Jinjanator and the code ported from j2cli, but my hand is forced here :-/

@mlasevich
Copy link
Author

Best I can tell, lint/coverage/docs should all be fixed.

@kpfleming
Copy link
Owner

The code all looks great; I have a number of changes I'd like to make to the various bits of documentation, and it will be most efficient for me to just make those and push them to your branch. If that's acceptable to you, I'll get that done within the next day or so.

@mlasevich
Copy link
Author

Hows it going? I hope you are not waiting on me for anything :-)

@kpfleming
Copy link
Owner

Ahh... you reacted positively to my question, but GitHub didn't email me about that, so I wasn't sure if you were OK with me making changes to your branch. Since you are, I'll probably get that done today.

@mlasevich
Copy link
Author

Ahh... you reacted positively to my question, but GitHub didn't email me about that, so I wasn't sure if you were OK with me making changes to your branch. Since you are, I'll probably get that done today.

Thanks. :-)

@kpfleming
Copy link
Owner

Apologies for the delay, returning home from FOSDEM and Config Management Camp made me pretty tired :-)

The docs have been improved, please take a look.

@mlasevich
Copy link
Author

Apologies for the delay, returning home from FOSDEM and Config Management Camp made me pretty tired :-)

The docs have been improved, please take a look.

Look good to me. Thanks for the cleanup :-)

@kpfleming kpfleming merged commit 1d7f90e into kpfleming:main Feb 9, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants