tide/CONTRIBUTING.md

90 lines
2.8 KiB
Markdown
Raw Normal View History

2020-05-31 04:03:41 +03:00
# Contributing
🌊 Thank you for contributing to Tide! 🌊
2020-08-09 04:49:19 +03:00
Please note that this project is released with a [Code of Conduct][]. By contributing to this project you agree to abide by its terms.
2020-05-31 04:03:41 +03:00
2020-08-09 04:49:19 +03:00
If you have any questions that aren't addressed in this document, please don't hesitate to open an issue!
2020-05-31 04:03:41 +03:00
## Code Conventions
2020-05-31 04:03:41 +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)
### 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.
- `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
2020-08-09 04:49:19 +03:00
## Testing
`tide test` runs tests from the `$_tide_dir/tests` folder using [fishtape][]. You can quickly install fisher and fishtape using `tide test -i`.
Example:
```console
tide test status
```
You can run the full test suite with the `-a/--all` flag.
```console
tide test -a
```
## Linting
2020-08-09 04:49:19 +03:00
Code linting is done via [`fish --no-execute`][].
Markdown and Yaml linting is done via the [Super-Linter][] action, which uses [Markdownlint][] and [Yamllint][].
## Formatting
2020-08-09 04:49:19 +03:00
Code formatting is done via [`fish_indent`][].
Markdown and Yaml formatting is done via [Prettier][].
2020-08-09 04:49:19 +03:00
## Documentation Conventions
All links should be in the [reference style][], with references at the bottom of the document in alphabetical order.
## Versioning
2020-08-09 05:27:41 +03:00
Tide does not use strict semantic versioning but instead whatever feels appropriate at the time.
2020-08-09 04:49:19 +03:00
2020-08-10 01:43:08 +03:00
For example Tide might:
2020-08-09 04:49:19 +03:00
- Bump the major version number for a large feature even if it's backwards compatible
2020-08-09 05:27:41 +03:00
- Make small non-backwards compatible changes in a minor version bump
2020-08-10 01:43:08 +03:00
- Not bump the patch version number for ultra minor fixes
2020-08-09 04:49:19 +03:00
[code of conduct]: CODE_OF_CONDUCT.md
2020-06-16 05:52:37 +03:00
[fishtape]: https://github.com/jorgebucaran/fishtape
2020-08-09 04:49:19 +03:00
[`fish --no-execute`]: https://fishshell.com/docs/current/cmds/fish.html
[`fish_indent`]: https://fishshell.com/docs/current/cmds/fish_indent.html
[markdownlint]: https://github.com/DavidAnson/markdownlint
[prettier]: https://github.com/prettier/prettier
2020-08-09 04:49:19 +03:00
[reference style]: https://www.markdownguide.org/basic-syntax/#reference-style-links
[super-linter]: https://github.com/github/super-linter
2020-08-09 04:49:19 +03:00
[yamllint]: https://github.com/adrienverge/yamllint