Skip to content

Commit

Permalink
docs: add functions signature in conventions (#64)
Browse files Browse the repository at this point in the history
## Description
Functions signatures convention have not be write on the documentation,
this pull request added it.

## Changes
- Add convention about functions signatures

## Checklist
- [x] I have read the **CONTRIBUTING.md** document.
- [x] My code follows the code style of this project.
- [x] I have added tests to cover my changes.
- [x] All new and existing tests passed.
- [x] I have updated the documentation accordingly.
- [x] This change requires a change to the documentation on the website.
  • Loading branch information
42atomys authored Aug 23, 2024
1 parent e33dad3 commit e72ad31
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/introduction/templating-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ description: >-
Use `has` for functions that check for the existence or presence of something.
* Follow the style guide for Idiomatic Naming Convention (e.g., [Initialisms](https://google.github.io/styleguide/go/decisions#initialisms))
* **Function Comments:** For all exported functions and methods, provide comments describing their behavior, input parameters, and return values.
* **Function Signature:** Functions should always adhere to the following rules:
* **Pipe Syntax:** Functions need to be designed to work with the pipe `|` syntax in the template engine.
* **Error Return:** Functions must have a dual output `(something, error)` to ensure proper error handling. Even when a function doesn't currently handle errors, the signature should still be `(something, error)` to allow for future error handling without causing breaking changes.

#### Raw examples of registration names with function signatures

Expand Down

0 comments on commit e72ad31

Please sign in to comment.