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.
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.
Basically download the latest release build and run the executable from the command line.
Have a look at ludtwig --help
for more information.
src/main.rs
src/process.rs
lib/twig
crate and does happen in serial for each file using parsing combinators.src/writer.rs
src/analyzer.rs
src/output.rs
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 (output in target/release/ludtwig
): cargo build --release
Run tests with (only of the application not it's dependencies like twig parser): 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'
Copyright (c) 2020 Malte Janz
ludtwig
is distributed under the terms of the MIT License.
See the LICENSE file for details.
If you build this project locally or use the distributed binary keep also the following licenses in mind: - nom - MIT - tokio - MIT - clap - MIT / Apache 2.0 - ansi_term - MIT - walkdir - MIT / UNLICENSE - async-trait - MIT / Apache 2.0
If you run the tests / benchmarks locally you also should keep these licenses in mind (not included in distributed binary): - criterion - 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