Skip to content

Commit

Permalink
docs: Improve feature description structure
Browse files Browse the repository at this point in the history
  • Loading branch information
romshark committed May 9, 2024
1 parent babb78a commit 4754772
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,29 @@ an error annotated with line and column in the YAML file if necessary.

## (anti-)Features

- 🚫 Forbids the use of `no`, `yes`, `on` and `off` for `bool`,
allows only `true` and `false`.
- 🚫 Forbids the use of `~` and `Null`, allows only `null` for nilables.
- 🚫 Forbids assigning `null` to non-nilables (which normally would assign zero value).
- ❗️ Requires `"yaml"` struct tags throughout your configuration struct type.
- ❗️ Requires `"env"` struct tags to be POSIX-style and
- Go restrictions:
- 🚫 Forbids recursive Go types.
- 🚫 Forbids the use of `any`, `int` & `uint` (unspecified width), and other types.
Only maps, slices, arrays and deterministic primitives are allowed.
- ❗️ Requires `"yaml"` struct tags throughout your configuration struct type.
- ❗️ Requires `"env"` struct tags to be POSIX-style and
forbids any non-primitive env var fields.
- ❗️ Allows only primitive fields with the `env` tag to be overwritten with env vars.
forbids any non-primitive env var fields.
- ❗️ Allows only primitive fields with the `env` tag to be overwritten with env vars.
- 🚫 Forbids recursive Go types.
- 🚫 Forbids the use of `any`, `int` & `uint` (unspecified width), and other types.
Only maps, slices, arrays and deterministic primitives are allowed.
- ❗️ Requires fields specified in the configuration type to be present in the YAML file.
- 🚫 Forbids fields in the YAML file that aren't specified by the Go type.
- Reports errors by `line:column` when it can.
- πŸͺ„ If any type within your configuration struct implements the `Validate` interface,
then its validation method will be called.
If it returns an error - the error will be reported.
Keep your validation logic close to your configuration type definitions.
- 🚫 Forbids non-pointer struct map values.
- YAML restrictions:
- 🚫 Forbids the use of `no`, `yes`, `on` and `off` for `bool`,
allows only `true` and `false`.
- 🚫 Forbids the use of `~` and `Null`, allows only `null` for nilables.
- 🚫 Forbids assigning `null` to non-nilables (which normally would assign zero value).
- 🚫 Forbids fields in the YAML file that aren't specified by the Go type.
- ❗️ Requires fields specified in the configuration type to be present in the YAML file.
- Features:
- πŸͺ„ If any type within your configuration struct implements the `Validate` interface,
then its validation method will be called.
If it returns an error - the error will be reported.
Keep your validation logic close to your configuration type definitions.
- Reports errors by `line:column` when it can.

## Example

Expand Down

0 comments on commit 4754772

Please sign in to comment.