Ludtwig

GitHub GitHub Workflow Status (branch) GitHub release (latest by date including pre-releases) Crates.io GitHub all releases Crates.io

A CLI tool for developers that tries to speedup the development workflow while working with templating (.twig) files. It focuses mainly on formatting the files with a uniform code style and detecting mistakes. It is only a "formatter" that can be run locally or in the pipeline, it will not report anything to your IDE.

Status / Disclaimer

Ludtwig is currently in an early development state. Please use the tool with caution and validate the changes that is has made (backup your files before running this). Feel free to create new issues and help to steer this project in the right direction.

Installation

Cargo (rust toolchain)

Run the following cargo command to install or update ludtwig: cargo install ludtwig
You can install cargo here: https://www.rust-lang.org/learn/get-started
If you don't want to install the rust toolchain / cargo you can still use the manual installation below.

Manual

Download the latest release binary for your operating system and put it in your PATH for easy access.

How to use Ludtwig?

After installation have a look at ludtwig --help for more information. It should be self explanatory.

Current features

Current limitations

Basic Concepts

Development setup

Make sure you have Rust installed on your system.
Clone this repository.

Run the project with parameters: cargo run -- filaA.twig
Build the project for production with: cargo build --release
(the produced binary will be here: target/release/ludtwig)
Run tests with: cargo test

If you want to benchmark the performance of the release build you could use Hyperfine and run it like so:
hyperfine -i 'ludtwig -o ./output ./my-template-folder'

License

Copyright (c) 2020 Malte Janz
ludtwig is distributed under the terms of the MIT License.
See the LICENSE file for details.

Dependencies / License notices*

If you build this project locally or use the distributed binary keep also the following licenses in mind: - ludtwig-parser - MIT - tokio - MIT - clap - MIT / Apache 2.0 - ansi_term - MIT - walkdir - MIT / UNLICENSE - async-trait - MIT / Apache 2.0

For testing purposes this repository also includes code from the following sources (not included in distributed binary): - Shopware - MIT - SwagMigrationAssistant - MIT

Special thanks goes to the authors of these dependencies.
*This list and the links may not be up to date and you should do your own research. Also deeper dependencies are not listed.