2020-05-31 04:03:41 +03:00
# Contributing
🌊 Thank you for contributing to Tide! 🌊
2020-07-14 18:31:27 +03:00
## Testing
2020-05-31 04:03:41 +03:00
2020-07-19 23:35:19 +03:00
The `tide test` command runs tests from the `$_tide_dir/tests` folder using [fishtape][]. You can quickly install fisher and fishtape using `tide test -i`
2020-05-31 04:03:41 +03:00
2020-07-14 18:31:27 +03:00
Example:
2020-05-31 04:03:41 +03:00
2020-07-05 00:01:35 +03:00
```console
2020-07-14 18:31:27 +03:00
tide test status
2020-05-31 04:03:41 +03:00
```
2020-07-14 18:31:27 +03:00
You can run all tests with the `-a` flag.
2020-05-31 04:03:41 +03:00
2020-07-05 00:01:35 +03:00
```console
2020-07-14 18:31:27 +03:00
tide test -a
2020-05-31 04:03:41 +03:00
```
2020-07-19 23:35:19 +03:00
## Code Conventions
2020-05-31 04:03:41 +03:00
2020-07-19 23:35:19 +03:00
### Style Guide
- `if` > `and` or `or`
2020-07-23 21:33:51 +03:00
- `test` > `[...]`
2020-07-23 20:57:40 +03:00
- `printf` > `echo`
2020-07-21 00:11:59 +03:00
- Long forms of flags > short forms
2020-07-23 20:57:40 +03:00
- Exceptions: `set` , `set_color` , `function foo -a` , "common knowledge" options for commands like `rm -r`
2020-07-23 21:33:51 +03:00
- Piping > command substitution (only when convenient, i.e no extra commands)
2020-07-19 23:35:19 +03:00
### Naming Conventions
Local variables should be named in `camelCase` .
- `set -l numberOfNewlines`
2020-07-23 21:33:51 +03:00
Anything exposed to the shell or user--functions, global/universal variables, and files--should be named in `snake_case` , beginning with `tide_` . Prepend an underscore if the user in not meant to interact directly with it.
2020-07-19 23:35:19 +03:00
- `set -g _tide_left_prompt_height`
- `set -U tide_right_prompt_items`
- `_tide_count_left_prompt_height.fish`
- `_tide_right_prompt`
- `tide_install`
#### Specific Naming Conventions
- Items begin with `_tide_item_`
- Subcommands begin with `_tide_sub_`
2020-06-16 05:52:37 +03:00
[fishtape]: https://github.com/jorgebucaran/fishtape