Cachet/CONTRIBUTING.md

79 lines
2.9 KiB
Markdown
Raw Normal View History

2014-11-16 22:26:08 +00:00
# Contribution Guidelines
2014-11-19 22:20:37 +00:00
## Creating issues
2015-08-05 08:47:32 +01:00
Feature requests and bug reports should be made by using the [issue tracker](https://github.com/cachethq/Cachet/issues). Support questions should be directed to our support email; [support@alt-three.com](mailto:support@alt-three.com?subject=Cachet Support).
2014-12-05 12:51:52 +00:00
2015-08-05 08:47:32 +01:00
**Always be respectful.** Organization members reserve the right to lock topics if they feel necessary.
2014-11-19 22:20:37 +00:00
## Languages
2015-08-05 08:47:32 +01:00
When needing to add labels, placeholders or general text, you **must not** write directly into the source file, rather make use of the `./resources/lang/` directory.
Always provide the English translation and copy your English string to all other languages - making sure that the indentation and alignment of the arrays are updated.
2014-11-19 22:20:37 +00:00
## Coding Standards
2014-11-22 14:04:51 +00:00
Please follow existing coding standards:
```php
<?php
2015-08-05 08:47:32 +01:00
namespace CachetHQ\Cachet\Controller;
2015-08-05 08:47:32 +01:00
use CachetHQ\Cachet\Bar;
2014-12-30 10:45:02 +00:00
class Foo extends Bar
{
public function baz()
{
if ($condition) {
}
}
}
2014-11-27 22:01:47 +00:00
```
- At least one newline separating `namespace`, `use`, `function` and `class` declarations.
2014-12-18 09:17:58 +00:00
- Spaces around operators, loops, conditions and control blocks:
2014-11-22 14:04:51 +00:00
```php
<?php
use \Exception;
if ($condition === (10 + 2)) {
try {
throw Exception("Something went wrong...");
} catch (Exception $e) {
// Do something here.
}
2014-11-22 14:04:51 +00:00
}
```
- Braces on a new line following: `namespace`, `use`, `function` and `class`.
2014-11-22 14:04:51 +00:00
- PHP constants should be in lowercase; `true`, `false` and `null`.
- Defined constants should always be in uppercase.
2014-11-27 22:01:47 +00:00
- Never leave trailing spaces at the end of a line.
- Files should end with one blank line.
- Do not use `# Bash` style comments.
- Always add or update Docblocs to functions.
2015-08-05 08:47:32 +01:00
- We use [StyleCI](https://styleci.io) to automatically check code standards in Pull Requests. If your PR fails the CI check, then apply the supplied patch and re-push.
2014-11-27 22:01:47 +00:00
If you're still unsure, then take a look at existing code.
## Introduction into Git and GitHub
If you are new to Git, GitHub and the whole open source software community, welcome! Here are some resources for getting started and understanding what it's all about.
- [Try Git](https://try.github.io/levels/1/challenges/1) by Code School
- [GitHub Help](https://help.github.com)
If you're not particularly fond of the command line, you can get one of GitHub's free GUI desktop apps:
- [GitHub for Mac](https://github.com/blog/1510-installing-git-from-github-for-mac)
- [GitHub for Windows](https://github.com/blog/1127-github-for-windows)
2014-12-18 09:17:58 +00:00
If you're feeling adventurous, you can become a Git & GitHub master with the [Git Path on Code School](https://www.codeschool.com/paths/git).
2015-08-05 08:47:32 +01:00
## .editorconfig
You should also make use of the [.editorconfig](/.editorconfig) file found within the root of the repository. It'll make sure that your editor is setup with the same file settings.