From ea651dd01b4c3517df48f374f2033def4d60604f Mon Sep 17 00:00:00 2001 From: Cedric Vangout Date: Sat, 3 Feb 2024 11:23:54 +0100 Subject: [PATCH] feat(ci): setup (#18) --- .github/workflows/ci.yml | 25 +++++++++++++++++++++++++ README.md | 30 +++++++++++++++++++++++++++++- parser/src/lib.rs | 1 + rewriter/src/parser.rs | 1 + 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6fc64ae --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: [push] + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +env: + RUSTFLAGS: --deny warnings + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@nightly + with: + components: clippy, rustfmt + - uses: swatinem/rust-cache@v2 + - run: cargo fmt --check + - run: cargo build + - run: cargo check + - run: cargo lint --all-targets + - run: cargo test diff --git a/README.md b/README.md index d3a8015..526e7e3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,33 @@ # jrsx -A JSX-like superset of [Askama][1]. +![CI](https://github.com/cvng/jrsx/actions/workflows/ci.yml/badge.svg?branch=main) + +A clean `JSX` syntax for your [Askama][1] templates. + + + + + + +
Before:
+ +```html +{%- import "hello.html" as hello_scope -%} +{%- import "child.html" as child_scope -%} + +{% call hello_scope::hello(name) %} +{% call hello_scope::hello(name=name) %} +{% call hello_scope::hello(name="world") %} +{% call child_scope::child() %}Super!{% endcall %} +``` +
After:
+ +```html + + + +Super! +``` +
[1]: https://djc.github.io/askama diff --git a/parser/src/lib.rs b/parser/src/lib.rs index 4d27d70..6d2d840 100644 --- a/parser/src/lib.rs +++ b/parser/src/lib.rs @@ -200,6 +200,7 @@ fn skip_till<'a, O>( ) -> impl FnMut(&'a str) -> ParseResult<'a, (&'a str, O)> { enum Next { IsEnd(O), + #[allow(dead_code)] NotEnd(char), } let mut next = alt((map(end, Next::IsEnd), map(anychar, Next::NotEnd))); diff --git a/rewriter/src/parser.rs b/rewriter/src/parser.rs index 29ebd65..3608067 100644 --- a/rewriter/src/parser.rs +++ b/rewriter/src/parser.rs @@ -194,6 +194,7 @@ fn skip_till<'a, O>( ) -> impl FnMut(&'a str) -> ParseResult<'a, (&'a str, O)> { enum Next { IsEnd(O), + #[allow(dead_code)] NotEnd(char), } let mut next = alt((map(end, Next::IsEnd), map(anychar, Next::NotEnd)));