2614 Commits

Author SHA1 Message Date
René Kijewski
ed216e5b2c Fix new clippy warnings in rust 1.89 2025-05-16 03:26:19 +02:00
Guillaume Gomez
150becaf0f
Merge pull request #433 from Kijewski/pr-linguist
Ignore fuzzing corpus from source line count
2025-05-13 07:43:27 +02:00
René Kijewski
077b83631a Ignore fuzzing corpus from source line count
Github's language statistics for the project say that 43% of askama is
assembly code. It is not. The heuristic counts our fuzzing corpus as
assembly code, and the corpus is quite big.

This PR excludes the corpus from being counted.
2025-05-12 18:38:43 +02:00
C0D3 M4513R
c31fce773e
Relax Sized constraint on impl FastWritable for Cow (#432)
* Add test to ensure `Cow<'_, str>` implements `FastWritable`

* Relax Sized constraint on `impl FastWritable for Cow`

* Run rustfmt

Signed-off-by: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com>

* Put "test" in a const block.

* Update cow_str_implements_fast_writable.rs

Co-authored-by: René Kijewski <Kijewski@users.noreply.github.com>

---------

Signed-off-by: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com>
Co-authored-by: René Kijewski <Kijewski@users.noreply.github.com>
2025-05-07 17:11:45 +02:00
Guillaume Gomez
73ba176ad5
Merge pull request #426 from Kijewski/pr-ensure_no_named_arguments
generator: fix `ensure_no_named_arguments()` test
2025-05-02 11:13:29 +02:00
Guillaume Gomez
4a7de4fde4
Merge pull request #427 from Kijewski/pr-remove-zizmor
ci: remove zizmor test
2025-05-02 11:13:02 +02:00
René Kijewski
979f9d8ef4 ci: remove zizmor test
It was a small script to test common Github action config errors, but
IMHO it became more opinionated with every release. No, I won't add a
hashsum to every `uses` line, thank you for asking again and again.

Also, it takes 3 minutes to build by now. 3 minutes until the first real
test is executed.
2025-05-02 01:09:35 +02:00
René Kijewski
a7c55f77fe generator: fix ensure_no_named_arguments() test
The wrong `Expr` variant was tested.
2025-05-02 00:54:18 +02:00
Guillaume Gomez
90d1a71801
Merge pull request #423 from m4tx/fix-function-docs
chore: fix tiny wording error in "Calling functions" docs
2025-04-30 18:19:14 +02:00
Mateusz Maćkowski
44c67d3ba1
chore: fix tiny wording error in "Calling functions" docs 2025-04-30 18:15:21 +02:00
Guillaume Gomez
9b41bb9ff5
Merge pull request #421 from Kijewski/pr-inline
Add missing `#[inline]` annotations
2025-04-29 11:49:37 +02:00
René Kijewski
01e9d3c640 Add missing #[inline] annotations 2025-04-27 21:30:19 +02:00
René Kijewski
bf5e066b68 generator: remove invisible group from output
The generated `TokenStream` gets parsed correctly by `rustc`, but fails
to be parsed by `syn` in some circumstances. E.g. the template syntax
`test {#` lets the playground crash.

This PR removes the invisible group.
2025-04-26 22:24:26 +02:00
dependabot[bot]
3cdc0ea4c1 build(deps): bump astral-sh/setup-uv from 5 to 6
Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 5 to 6.
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/v5...v6)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-25 01:17:27 +02:00
Guillaume Gomez
95867ac8ce
Merge pull request #416 from Kijewski/pr-upgrading-0.14
Get ready for v0.14.0
v0.14.0
2025-04-23 15:12:34 +02:00
René Kijewski
61b7422497 Add |titlecase as alias for |title 2025-04-22 23:37:23 +02:00
René Kijewski
79be271593 Run doctests 2025-04-22 23:37:23 +02:00
René Kijewski
72bbe3ede1 Bump version number to v0.14.0 2025-04-22 23:37:23 +02:00
René Kijewski
57750338fa book: update upgrading.md 2025-04-22 23:37:23 +02:00
Guillaume Gomez
a5b43c0aa2 Fix unique filter implementation 2025-04-22 23:36:56 +02:00
Guillaume Gomez
7fccbdf1d7 Remove usage of nextest 2025-04-22 11:34:55 +02:00
Guillaume Gomez
6a16256f24 Fix new clippy lints 2025-04-22 11:34:55 +02:00
Guillaume Gomez
04a4d5b020 Update MSRV to 1.83 2025-04-22 11:34:55 +02:00
Guillaume Gomez
d2a788a740 Add doc about unique filter 2025-04-22 11:34:55 +02:00
Guillaume Gomez
d0d23cad0b Add unique filter 2025-04-22 11:34:55 +02:00
Guillaume Gomez
6f912abee6 Move FastWritable into askama root 2025-04-22 11:33:57 +02:00
Guillaume Gomez
7c5deda4c1 Rename pluralize arguments into singular and plural 2025-04-21 23:11:24 +02:00
René Kijewski
6cea91a9b5 Update book page about filters 2025-04-21 23:11:24 +02:00
René Kijewski
b402936db3 generator: add named arguments for filters 2025-04-21 23:11:24 +02:00
René Kijewski
6f8de0ca84 generator: fix test for filters that need alloc 2025-04-21 23:11:24 +02:00
René Kijewski
4be302338a generator: do argument coercion for |truncate / |center
Don't simply pass any arguments to the filter. The error message won't
be useful otherwise. Also ensure that the argument is a `usize`.
2025-04-21 23:11:24 +02:00
René Kijewski
de9d6b7d0e generator: BUILTIN_FILTERS_NEED_ALLOC should check built-in filters 2025-04-21 23:11:24 +02:00
René Kijewski
4fe13a0053 generator: add missing lifetimes 2025-04-21 23:11:24 +02:00
René Kijewski
9f9a7dcf43 generator: remove leading _ from method names 2025-04-21 23:11:24 +02:00
René Kijewski
74cb9917a0 generator: move filters into their own file 2025-04-21 23:11:24 +02:00
René Kijewski
8fd58a0656 generator: copy expr.rs to filter.rs to make the next diff more readable 2025-04-21 23:11:24 +02:00
Guillaume Gomez
12db32bd2d
Merge pull request #413 from Kijewski/pr-throughput
Add throughput to derive benchmark
2025-04-21 11:31:26 +02:00
René Kijewski
704a33beda Add throughput to derive benchmark 2025-04-20 23:55:03 +02:00
Guillaume Gomez
4c0398ad67
Merge pull request #407 from Kijewski/pr-book-fast-writable
book: add page about `FastWritable`
2025-04-20 12:40:36 +02:00
Guillaume Gomez
7cb3ac0879
Merge pull request #410 from Kijewski/pr-fix-rtd
Update to more current rust version on readthedocs
2025-04-20 11:45:48 +02:00
René Kijewski
72c46f452f Update to more current rust version on readthedocs
Our documentation needs nightly features `doc_cfg`, `doc_auto_cfg` to
build. Instead of using the nightly channel, which is not available on
readthedocs.org, we opt in to nightly features by setting the
environment variable `RUSTC_BOOTSTRAP` to `1`. This gives on unstable
features in a stable channel.

Our dependency `proc-macro2` tests if opting-in to unstable feature is
possible, and if so, it expects that it runs on a quite recent `nightly`
release. The newest rust version that is available out-of-the-box on
readthedocs is rust 1.82, which is not *that* recent anymore, being
released on 2024-08-30.

This PR makes use of the readly configured tool `asdf` to select a more
recent rust version semi-manually.
2025-04-19 23:30:26 +02:00
René Kijewski
94fddd4df5 book: add page about FastWritable 2025-04-19 22:09:28 +02:00
René Kijewski
7881bc131b Implement first and blank arguments for |indent 2025-04-17 15:07:21 +02:00
René Kijewski
ba33974996 Let |indent use AsIndent 2025-04-17 15:07:21 +02:00
Guillaume Gomez
2c1e86e410
Merge pull request #397 from Kijewski/pr-fast-writable-values
Pass variables to sub-templates more reliably even if indirectly
2025-04-17 11:41:54 +02:00
René Kijewski
c6d45e1cdc Always supply values to custom filters 2025-04-15 17:15:47 +02:00
René Kijewski
f7fc39d138 Implement |wordcount filter with access to runtime values 2025-04-15 13:24:19 +02:00
René Kijewski
22648acf08 book: how to access runtime values in custom filters 2025-04-15 13:24:19 +02:00
René Kijewski
20af543610 Pass values through alloc filters, too 2025-04-15 13:24:18 +02:00
René Kijewski
d6bf966048 Pass variables to sub-templates more reliably even if indirectly 2025-04-15 13:13:35 +02:00