engelsystem/CONTRIBUTING.md

32 lines
2.2 KiB
Markdown
Raw Permalink Normal View History

2019-12-01 15:50:31 +01:00
# Contributing
2020-01-17 14:58:42 +01:00
## Coding guide lines
2020-05-13 18:40:03 +02:00
* Make sure your code follows the [PSR-12](https://www.php-fig.org/psr/psr-12/) code style and is [.editorconfig](.editorconfig) valid.
You may use `composer run phpcs` and [Editorconfig-Checker](https://editorconfig-checker.github.io) to verify that.
2022-11-26 14:50:15 +01:00
* You should use an [editorconfig plugin for your editor](https://editorconfig.org/#pre-installed) for automatic basic code formatting.
2019-12-01 15:50:31 +01:00
* Use `use` statements wherever possible instead of writing the fully qualified name.
2022-12-04 14:08:06 +01:00
* Code must pass PHPStan checks (`composer phpstan`)
2019-12-01 15:50:31 +01:00
* Order the composer/npm dependencies alphabetically.
2022-10-01 20:53:17 +02:00
* Do not use code from the [includes](includes) directory anywhere else.
* Don't refactor [includes](includes) code just for the sake of change, it is legacy code that must only be replaced.
2022-10-01 20:53:17 +02:00
* Please cover your code by unit tests, our goal is to stay at 100% line coverage.
Code under `includes` does not require tests as it's mostly not testable and needs to be rewritten.
* Do not use vendor prefixes like `-webkit` in styles.
2022-10-01 20:53:17 +02:00
This is done by PostCSS + Autoprefixer according to the [`.browserslistrc`](.browserslistrc).
* Translations must be abbreviated, for example `form.save`.
The `default.po` files contain translations that can be auto-detected using Poedit, `additional.po` contains generated messages like validations.
2022-12-22 18:28:51 +01:00
* JavaScript code must pass the checks `yarn lint`.
2022-11-26 14:50:15 +01:00
Auto-fixing is supported via `yarn lint:fix`.
* Don't put function calls in a template-literal (template-strings).
2020-01-17 14:58:42 +01:00
## Pull requests
2022-10-01 20:53:17 +02:00
* The PR should contain a short overview of the changes.
* Before implementing bigger changes, please open an issue to discuss the feature and possible implementation options.
* Please create single pull requests for every feature instead of creating one big monster of pull request containing a complete rewrite.
* Squash similar commits to make the review easier.
* For visual changes, include both before and after screenshots to easily compare and discuss changes.
## Commits
* The commit message must be meaningful. It should serve as a short overview of the changes.
If needed, an additional description can be provided.
* A commit should be self-contained and result in a working Engelsystem.