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

Update CONTRIBUTING guide #2261

Merged
merged 2 commits into from
Apr 11, 2024
Merged
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
60 changes: 41 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,50 @@
Contributing
============
# Contributing

First of all, **thank you** for contributing, **you are awesome**!
First of all, **thank you** for contributing, **you are awesome**! With your contribution, you not only improve this
bundle, but also become part of a [great community](https://github.com/nelmio/NelmioApiDocBundle/graphs/contributors)
maintaining it.

Here are a few rules to follow in order to ease code reviews, and discussions before
maintainers accept and merge your work.
## Guidelines

You MUST follow the [PSR-1](http://www.php-fig.org/psr/psr-1/) and
[PSR-2](http://www.php-fig.org/psr/psr-2/). If you don't know about any of them, you
should really read the recommendations. Can't wait? Use the [PHP-CS-Fixer
tool](http://cs.sensiolabs.org/).
Here are a few guidelines to follow in order to ease code reviews, and discussions before maintainers can accept and
merge your work. Thank you!

You MUST run the test suite (run `composer update`, and then execute `composer run phpunit`).
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
"RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in
[RFC 2119](https://datatracker.ietf.org/doc/html/rfc2119).

You MUST write (or update) unit tests.
### Code Style

You SHOULD write documentation.
Code MUST adhere to all rules outlined in the
[Symfony Coding Standards](https://symfony.com/doc/current/contributing/code/standards.html) as
defined by the [@Symfony](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/ruleSets/Symfony.rst) rule set,
utilized by the [PHP-CS-Fixer](https://cs.symfony.com) tool.

Please, write [commit messages that make
sense](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),
and [rebase your branch](http://git-scm.com/book/en/Git-Branching-Rebasing)
before submitting your Pull Request.
You SHOULD run `composer run phpcs-check` to check for any violations. You SHOULD run `composer run phpcs-fix` to
fix any potential issues.

Also, while creating your Pull Request on GitHub, you MUST write a description
which gives the context and/or explains why you are creating it.
### Code Quality

Thank you!
You MUST use the static analysis tool [PHPStan](https://phpstan.org/) to analyse any newly added or revised code within
this bundle.

You MUST run `composer run phpstan` to check for any violations. You MUST fix all violations related to any newly added
or revised code.

### Tests

You MUST write (or update) unit and/or functional tests for any newly added or revised functionality within this bundle.

You MUST validate newly added or revised tests by running `composer run phpunit`.

### Documentation

You SHOULD write (or update) documentation.

You SHOULD write
[commit messages that make sense](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).

You MUST [rebase your branch](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) before submitting your Pull Request.

While creating your Pull Request on GitHub, you MUST write a description which gives the context and/or explains why you
are creating it.
Loading