Commit graph

13 commits

Author SHA1 Message Date
Alexandre Gomes Gaigalas 15f148da24 Dusting off. See CHANGELOG.md for more details on this commit 2023-02-13 03:59:11 -03:00
Henrique Moody 408d8e825b
Move "Message placeholder conversion" documentation
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-05-22 20:56:22 +02:00
Henrique Moody 5c0bd3a5da
Move "Message translation" documentation
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-05-22 20:56:09 +02:00
Henrique Moody 7be7f0f58c
Move "Custom rules" documentation
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-05-22 20:55:59 +02:00
Danilo Correa fbf82dc975
Replace removed rule from documentation
The "Age" was removed but the documentation was not completely updated.
2019-05-22 20:37:28 +02:00
Henrique Moody 3093d79155
Allow to customize parameter stringifier
We have seen users that want to change the default behavior of parameter
stringifier:

* Change the depth level shown from an array.

* Change the number of elements shown from an array.

* Not add quotes to some parameters.

Because of that, this commit will allow users to customize the parameter
stringifier.

This commit will also update the documentation to instruct how to
customize it.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-05-12 13:49:54 +02:00
Henrique Moody ab602ae1bb
Improve how to customize the Factory
The constructor of "Factory" has three arguments and, even though none
of them are needed, they are all required. Those arguments allow users
to customize the namespaces of rules and exceptions, and also to define
a callable that will translate the template messages.

This commit will remove those parameters from the constructor of
"Factory," and create methods that will allow users to customize the
namespaces and the translator.

The methods that this commit will create will not change the state of
"Factory," but they will create a clone with the customizations. It is
imperative that the "Factory" is immutable. Since the "Factory" is a
Singleton, allowing it to change could cause unexpected behaviors.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-05-12 12:24:44 +02:00
Henrique Moody f3bc39066b
Make default templates non-static and protected
The only reason why those templates are static is so users can overwrite
the exception messages. That was useful when we didn't have a handy
translator, but now that we can define a translator through the Factory,
this is not needed anymore.

Besides, having those properties public adds complexity to the code.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2019-05-12 09:57:07 +02:00
Henrique Moody 81ce5b090b
Merge branch '1.1' 2019-03-31 15:40:12 +02:00
bagus erlang 120d924d8d
Fix coding standard of code in the "Feature guide" 2019-02-10 12:41:37 +01:00
Lee Hesselden 780233a44b
Updated documentation about custom rules
The documentation about custom rules does not specify that creating an
exception for the rule is necessary. This commit will add that to the
documentation with an example to make it explicit.

Co-authored-by: Henrique Moody <henriquemoody@gmail.com>
2018-12-02 11:23:04 +01:00
Henrique Moody 4354652195
Merge branch '1.1' 2018-08-23 02:12:44 +02:00
Henrique Moody 52614d600d
Organize documentation for "Read the Docs"
The current documentation is hosted via GitHub pages rendered by
"Couscous". Every time we need a new version of the documentation
published we need to manually execute the "couscous".

This commit reorganize the documentation to be published to
"Read the Docs" because it will also allow us to have documentations per
version of the library most importantly provider a search field for the
documentation.

The documentation will be then published on:
https://respect-validation.readthedocs.io/

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2018-08-23 01:59:39 +02:00
Renamed from docs/README.md (Browse further)