Commit graph

5 commits

Author SHA1 Message Date
Alexandre Gomes Gaigalas
d9cdc118b2 Introduce REUSE compliance
This commit introduces REUSE compliance by annotating all files
with SPDX information and placing the reused licences in the
LICENSES folder.

We additionally removed the docheader tool which is made obsolete
by this change.

The main LICENSE and copyright text of the project is now not under
my personal name anymore, and it belongs to "The Respect Project
Contributors" instead.

This change restores author names to several files, giving the
appropriate attribution for contributions.
2026-01-21 06:28:11 +00:00
Henrique Moody
daf3d9389d
Change order of arguments in Templated rule
Having the template itself as a first argument makes the rule way more
intuitive. The third parameter is not as used as the first one, so, even
though it's very connected with the template, I thought it was better to
keep it as the third argument.
2026-01-04 15:21:50 +01:00
Henrique Moody
d9380588e7
Remove the setTemplate() method from Validator
The `setTemplate()` method can be confusing, as it can be tricky for
someone to determine which chain is being templated. Using the
`Templated` rule makes this much more explicit and adds a little bit of
verbosity. For users, this will be a significant change, but there are
easy ways to update this code in their projects, so I’m not overly
concerned about it.

Another benefit of this change is that it makes the `Validator` much
simpler, as it no longer needs to track the template. This change also
makes the `Reducer` simpler, for similar reasons to the `Validator`.
However, because the `Validator` is simpler, we can remove the code that
the `Reducer` had to meet the specific needs of the `Validator`.
2026-01-02 15:45:23 +01:00
Henrique Moody
48405271c5
Replace placeholder "name" with "subject"
The `{{name}}` placeholder could represent different things depending on
the state of the Result, and referring to it as `{{name}}` seems
arbitrary. This commit changes it to `{{subject}}`, which is much more
generic and it describes well what that placeholder can mean.
2025-12-26 21:30:01 +01:00
Henrique Moody
5b00d69766
Update how we handle templates
Currently, the templates that a user provides when running `assert()`
can significantly impact how the message is displayed. Because of this,
the formatters become complex as they all need to handle similar
conditions to format results.

This commit changes this behaviour, letting only the
`InterpolationRenderer` handle the templates. This makes the code
simpler and allows people to use the `InterpolationRenderer` directly,
without needing to figure out how to handle templates. Thinking about it
further, I believe handling templates is a concern for the `Renderer`
anyway, and this will open the way to other improvements using the
renderer.

I also removed the exception that is thrown when the template is not a
string, because I think that after validation has failed, we should not
throw any other exceptions, as that could cause unexpected errors for
users.
2025-12-22 14:05:55 +01:00