Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: updated coding style standard #642

Merged
merged 4 commits into from
Apr 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions buildtools/changelog.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'improvement' => '♻️ Refactoring',
'refactor' => '♻️ Refactoring',
'refactored' => '♻️ Refactoring',
'refactoring' => '♻️ Refactoring',
'deprecated' => '♻️ Refactoring',
'deprecate' => '♻️ Refactoring',
'remove' => '♻️ Refactoring',
Expand Down
12 changes: 11 additions & 1 deletion docpages/advanced_reference/coding_style_standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ Where discord provide a name in PascalCase we should stick as closely to that na
## Don't introduce any platform-specific code
Do not introduce platform specific (e.g. windows only) code or libc functions. If you really must use these functions safely wrap them e.g. in `#ifdef _WIN32` and provide a cross-platform alternative so that it works for everyone.

## C++ version

The code must work with the C++17 standard.

## Select the right size type for numeric types
If a value will only hold values up to 255, use `uint8_t`. If a value cannot hold over 65536, use `uint16_t`. These types can help use a lot less ram at scale.

Expand Down Expand Up @@ -114,6 +118,12 @@ All types for the library should be within the `dpp` namespace. There are a coup

## Commit messages and Git

All pull requests ("PRs") should be submitted against the `dev` branch in GitHub. It’s good to have descriptive commit messages, or PR titles so that other contributors can understand about your commit or the PR Created. Read [conventional commits](https://www.conventionalcommits.org/en/v1.0.0-beta.3/) for information on how we like to format commit messages.
All pull requests ("PRs") should be submitted against the `dev` branch in GitHub.

### Naming conventions

It’s good to have descriptive commit messages, or PR titles so that other contributors can understand about your commit or the PR Created. Commits must be prefixed with a type, which consists of a noun, `feat`, `fix`, etc., followed by a colon and a space. Other commit types can be `breaking`, `docs`, `refactor`, `deprecate`, `perf`, `test`, `chore` and `misc`. Read [conventional commits](https://www.conventionalcommits.org/en/v1.0.0-beta.3/) for more information on how we like to format commit messages.

### GitHub Actions

All PRs must pass the [GitHub Actions](https://github.com/brainboxdotcc/DPP/actions) tests before being allowed to be merged. This is to ensure that no code committed into the project fails to compile on any of our officially supported platforms or architectures.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int main()
{
dpp::cluster bot("token");

bot.on_log(dpp::utility::cout_logger());
bot.on_log(dpp::utility::cout_logger());

/* Create command handler, and specify prefixes */
dpp::commandhandler command_handler(&bot);
Expand Down Expand Up @@ -48,7 +48,7 @@ int main()
/* Command description */
"A test ping command",

/* Guild id (omit for a global command) */
/* Guild id (omit for a guild command) */
819556414099554344
);

Expand Down