From 050e7eed6cdf335e01724ae80be0520f3ea67885 Mon Sep 17 00:00:00 2001 From: Tavo Nieves J Date: Sat, 12 Dec 2020 22:20:55 -0500 Subject: [PATCH 1/3] Adding CONTRIBUTING.md --- CONTRIBUTING.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..e39ad1d7 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,49 @@ +# How to Contribute + +If you want to add or modify the documentation of the functions of this module, +the editor of Github.com may be enough for that task. + +If instead you plan to edit or add some new function to this module, hey, you rock! + +To do it, make sure you have the test project for this module installed [Codeception/symfony-module-test](https://github.com/Codeception/symfony-module-tests): + +After having installed it and confirming that all tests pass, you can start editing the source code in: +``` +vendor/codeception/module-symfony/src/Codeception/Module/Symfony.php +``` +If you are going to add a new function or modify in some way the parameters of an existing function, make sure to execute: + +```bash +vendor/bin/codecept clean +vendor/bin/codecept build +``` + +This way your new function will be available in your functional tests and your IDE should be able to autocomplete it. + +Keep in mind that any new function needs a corresponding test. + +If that's your case, create a test with the same name as your new function inside: + +``` +tests/Functional/SymfonyModuleCest.php +``` + +following alphabetical order, and verify that it works correctly with various test data. All good? Great! + +You can now send your contribution to the project, for that you will only have to fork the project on GitHub, +clone it and create a branch: +```bash +git clone https://github.com/YourUserName/module-symfony.git +git branch +``` + +And paste your changes. Then, just do: + +```bash +git commit +git push --set-upstream origin +``` +Finally go back to GitHub and create a Pull Request from `the branch of your fork` to the `master` of this project. + + + From 1108a50911c04021a4a9edc02ee68e6218794590 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Wed, 16 Dec 2020 19:53:47 +0100 Subject: [PATCH 2/3] Update CONTRIBUTING.md (#1) --- CONTRIBUTING.md | 84 ++++++++++++++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 32 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e39ad1d7..b4e0d4c5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,49 +1,69 @@ # How to Contribute -If you want to add or modify the documentation of the functions of this module, -the editor of Github.com may be enough for that task. +First of all: Contributions are very welcome! -If instead you plan to edit or add some new function to this module, hey, you rock! +Does your change require a test? -To do it, make sure you have the test project for this module installed [Codeception/symfony-module-test](https://github.com/Codeception/symfony-module-tests): +## Yes, My Change Requires a Test -After having installed it and confirming that all tests pass, you can start editing the source code in: -``` -vendor/codeception/module-symfony/src/Codeception/Module/Symfony.php -``` -If you are going to add a new function or modify in some way the parameters of an existing function, make sure to execute: +So you're going to add or modify functionality? Hey, you rock! -```bash -vendor/bin/codecept clean -vendor/bin/codecept build -``` +You can use our prepared [Codeception/symfony-module-test](https://github.com/Codeception/symfony-module-tests). It is a minimal (but complete) Symfony project, ready to run tests. -This way your new function will be available in your functional tests and your IDE should be able to autocomplete it. +1. On https://github.com/Codeception/symfony-module-tests, click on the "Fork" button. Then, in your terminal, do: + ```bash + git clone https://github.com/YourUserName/symfony-module-tests.git + cd symfony-module-tests + git checkout -b new_feature + ``` -Keep in mind that any new function needs a corresponding test. +2. Edit the module's source code in `vendor/codeception/module-symfony/src/Codeception/Module/Symfony.php` of this project. If you want, you can already write the tests (see step 7). -If that's your case, create a test with the same name as your new function inside: +3. On https://github.com/Codeception/module-symfony, click on the "Fork" button. Then, in your terminal, go to another directory, then: + ```bash + git clone https://github.com/YourUserName/module-symfony.git + cd module-symfony + git checkout -b new_feature + ``` -``` -tests/Functional/SymfonyModuleCest.php -``` +4. Copy your changed code parts from the test project's `Symfony.php` to this fork's `src/Codeception/Module/Symfony.php` -following alphabetical order, and verify that it works correctly with various test data. All good? Great! +5. Commit: + ```bash + git add --all + git commit --message="Briefly explain what your change is about" + git push --set-upstream origin new_feature + ``` -You can now send your contribution to the project, for that you will only have to fork the project on GitHub, -clone it and create a branch: -```bash -git clone https://github.com/YourUserName/module-symfony.git -git branch -``` +6. In the CLI output, click on the link to https://github.com/YourUserName/module-symfony/pull/new/new_feature to create a Pull Request through GitHub.com. -And paste your changes. Then, just do: +Now wait for feedback on your Pull Request. +If all is fine, then ... -```bash -git commit -git push --set-upstream origin -``` -Finally go back to GitHub and create a Pull Request from `the branch of your fork` to the `master` of this project. +### ... Write the Test +7. In the test project (`symfony-module-tests`), create a test with the same name as your new function in `tests/Functional/SymfonyModuleCest.php`, following alphabetical order. + Hint: Run this to rebuild Codeception's "Actor" classes (see [Console Commands](https://codeception.com/docs/reference/Commands#Build)) to get auto-completion in your IDE: + ```bash + vendor/bin/codecept clean + vendor/bin/codecept build + ``` +8. Run the tests with `vendor/bin/codecept run Functional` +9. Commit: + ```bash + git add --all + git commit --message="Add a link to the module's Pull Request you created above" + git push --set-upstream origin new_feature + ``` + +10. In the CLI output, click on the link to https://github.com/YourUserName/symfony-module-test/pull/new/new_feature to create a Pull Request through GitHub.com. + + +## No, My Change Does Not Require a Test + +So you're going to improve documentation, or just do a really minor code change? Hey, you rock too! + +* Either just edit https://github.com/Codeception/module-symfony/blob/master/src/Codeception/Module/Symfony.php on GitHub's website. +* Or follow steps 3 through 6 from above to do it on your local machine. From 669f54b923cea8f2e2b1a5d740fd9242f158c40b Mon Sep 17 00:00:00 2001 From: Tavo Nieves J Date: Wed, 16 Dec 2020 20:33:38 -0500 Subject: [PATCH 3/3] Update CONTRIBUTING.md Co-authored-by: ThomasLandauer --- CONTRIBUTING.md | 106 +++++++++++++++++++++++++++--------------------- 1 file changed, 60 insertions(+), 46 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b4e0d4c5..d6b6c12a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,68 +2,82 @@ First of all: Contributions are very welcome! -Does your change require a test? +**Does your change require a test?** -## Yes, My Change Requires a Test +## No, my change does not require a test +So you're going to make a small change or improve the documentation? Hey, you rock! -So you're going to add or modify functionality? Hey, you rock! +- Either just edit [`Symfony.php`](https://github.com/Codeception/module-symfony/blob/master/src/Codeception/Module/Symfony.php) on GitHub's website. +- Make sure to add a descriptive title and add an explanation for your changes. -You can use our prepared [Codeception/symfony-module-test](https://github.com/Codeception/symfony-module-tests). It is a minimal (but complete) Symfony project, ready to run tests. +> :bulb: You can also create a *fork* and *cloning it* on your local machine, as explained in the next section. -1. On https://github.com/Codeception/symfony-module-tests, click on the "Fork" button. Then, in your terminal, do: - ```bash - git clone https://github.com/YourUserName/symfony-module-tests.git - cd symfony-module-tests - git checkout -b new_feature - ``` +## Yes, my change requires a test -2. Edit the module's source code in `vendor/codeception/module-symfony/src/Codeception/Module/Symfony.php` of this project. If you want, you can already write the tests (see step 7). +So you're going to add or modify functionality? Hey, you rock too! -3. On https://github.com/Codeception/module-symfony, click on the "Fork" button. Then, in your terminal, go to another directory, then: - ```bash - git clone https://github.com/YourUserName/module-symfony.git - cd module-symfony - git checkout -b new_feature - ``` +You can use our prepared [Codeception/symfony-module-tests](https://github.com/Codeception/symfony-module-tests). +It is a minimal (but complete) Symfony project, ready to run tests. + +### 1. Edit locally -4. Copy your changed code parts from the test project's `Symfony.php` to this fork's `src/Codeception/Module/Symfony.php` +- Go to [Codeception/symfony-module-tests](https://github.com/Codeception/symfony-module-tests) and fork the project. + Then follow the installation instructions. +
+- Edit the module's source code in the `vendor/codeception/module-symfony/src/Codeception/Module/Symfony.php` file. +
+- If you created a new method, you can test it by adding a test in the `tests/Functional/SymfonyModuleCest.php` file. +> :bulb: Be sure to Rebuild Codeception's "Actor" classes (see [Console Commands](https://codeception.com/docs/reference/Commands#Build)): +> ```shell +> vendor/bin/codecept clean +> vendor/bin/codecept build +> ``` +> With this, your IDE will be able to recognize and autocomplete your new method. -5. Commit: - ```bash - git add --all - git commit --message="Briefly explain what your change is about" - git push --set-upstream origin new_feature - ``` +- Then, run the tests with the `vendor/bin/codecept run Functional` command. -6. In the CLI output, click on the link to https://github.com/YourUserName/module-symfony/pull/new/new_feature to create a Pull Request through GitHub.com. +### 2. Confirm your changes -Now wait for feedback on your Pull Request. -If all is fine, then ... +- If you are satisfied with your changes, the next step is to fork [Codeception/symfony-module](https://github.com/Codeception/module-symfony). + In your terminal, go to another directory, then: + ```shell + # Clone the repo + git clone https://github.com/YourUserName/module-symfony.git -### ... Write the Test + # Create a new branch for your change + cd module-symfony + git checkout -b new_feature + ``` +> :bulb: If you've created a fork before, make sure to [sync the changes](https://stackoverflow.com/a/7244456). + +- Copy the changes from the `Symfony.php` of the test project to the `src/Codeception/Module/Symfony.php` file on your Module's fork. +
+- Commit: + ```shell + git add --all + git commit --message="Briefly explain what your change is about" + git push --set-upstream origin new_feature + ``` -7. In the test project (`symfony-module-tests`), create a test with the same name as your new function in `tests/Functional/SymfonyModuleCest.php`, following alphabetical order. - Hint: Run this to rebuild Codeception's "Actor" classes (see [Console Commands](https://codeception.com/docs/reference/Commands#Build)) to get auto-completion in your IDE: - ```bash - vendor/bin/codecept clean - vendor/bin/codecept build - ``` +### 3. Create a Pull Request -8. Run the tests with `vendor/bin/codecept run Functional` +- In the CLI output, click on the link to `https://github.com/YourUserName/module-symfony/pull/new/new_feature` to create a Pull Request through GitHub.com. -9. Commit: - ```bash - git add --all - git commit --message="Add a link to the module's Pull Request you created above" - git push --set-upstream origin new_feature - ``` +Now wait for feedback on your Pull Request. If all is fine and gets merged... -10. In the CLI output, click on the link to https://github.com/YourUserName/symfony-module-test/pull/new/new_feature to create a Pull Request through GitHub.com. +### 4. Send a Test +- In the test project (`symfony-module-tests`), create a test with the same name as your new method in `tests/Functional/SymfonyModuleCest.php`, following alphabetical order. -## No, My Change Does Not Require a Test +- Run the tests with `vendor/bin/codecept run Functional` command. -So you're going to improve documentation, or just do a really minor code change? Hey, you rock too! +- Commit: + ```shell + git checkout -b new_test + git add --all + git commit --message="Describe what feature you are testing" + git push --set-upstream origin new_test + ``` -* Either just edit https://github.com/Codeception/module-symfony/blob/master/src/Codeception/Module/Symfony.php on GitHub's website. -* Or follow steps 3 through 6 from above to do it on your local machine. +- In the CLI output, click on the link to `https://github.com/YourUserName/symfony-module-tests/pull/new/new_test` to create a Pull Request through `GitHub.com`. + Don't forget to add a link to the module's Pull Request you created.