You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contributing/pull_request.md
+73-41Lines changed: 73 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,14 +13,16 @@ We expect all contributions to
13
13
> added to our test suite to prove the code works.
14
14
15
15
If pull requests are not accompanied by relevant tests, they will likely be closed.
16
-
Since we are a team of volunteers, we don't have any more time to work on the framework than you do. Please
17
-
make it as painless for your contributions to be included as possible.
16
+
Since we are a team of volunteers, we don't have any more time to work on the
17
+
framework than you do. Please make it as painless for your contributions to be
18
+
included as possible.
18
19
19
20
If you need help with getting tests running on your local machines, ask for help
20
21
on the [forum](https://forum.codeigniter.com/forumdisplay.php?fid=27). We would
21
22
be happy to help out.
22
23
23
-
The [Open Source Guide](https://opensource.guide/) is a good first read for those new to contributing to open source!
24
+
The [Open Source Guide](https://opensource.guide/) is a good first read for those
25
+
new to contributing to open source!
24
26
25
27
## CodeIgniter Internals Overview
26
28
@@ -35,7 +37,8 @@ Your Pull Requests (PRs) need to meet our guidelines.
35
37
36
38
If your Pull Requests fail to pass these guidelines, they will be declined,
37
39
and you will need to re-submit when you've made the changes.
38
-
This might sound a bit tough, but it is required for us to maintain the quality of the codebase.
40
+
This might sound a bit tough, but it is required for us to maintain the quality
41
+
of the codebase.
39
42
40
43
### PHP Style
41
44
@@ -44,10 +47,11 @@ This might sound a bit tough, but it is required for us to maintain the quality
44
47
All code must conform to our [Style Guide](./styleguide.md), which is
45
48
based on PSR-12.
46
49
47
-
This makes certain that all submitted code is of the same format
48
-
as the existing code and ensures that the codebase will be as readable as possible.
50
+
This makes certain that all submitted code is of the same format as the existing
51
+
code and ensures that the codebase will be as readable as possible.
49
52
50
-
You can fix most of the coding style violations by running this command in your terminal:
53
+
You can fix most of the coding style violations by running this command in your
54
+
terminal:
51
55
52
56
```console
53
57
composer cs-fix
@@ -61,7 +65,8 @@ composer cs
61
65
62
66
### Unit Testing
63
67
64
-
If you are not familiar with Unit Testing, see [the forum thread](https://forum.codeigniter.com/showthread.php?tid=81830).
68
+
If you are not familiar with Unit Testing, see
69
+
[the forum thread](https://forum.codeigniter.com/showthread.php?tid=81830).
65
70
66
71
Unit testing is expected for all CodeIgniter components. We use PHPUnit,
67
72
and run unit tests using GitHub Actions for each PR submitted or changed.
@@ -112,8 +117,8 @@ then you will need to add to the documentation.
112
117
New classes, methods, parameters, changing default values, changing behavior etc.
113
118
are all changes that require a change to documentation.
114
119
115
-
Also, the [Changelog](https://codeigniter4.github.io/CodeIgniter4/changelogs/index.html) must be updated for every change,
116
-
and PHPDoc blocks must be maintained.
120
+
Also, the [Changelog](https://codeigniter4.github.io/CodeIgniter4/changelogs/index.html)
121
+
must be updated for every change, and PHPDoc blocks must be maintained.
117
122
118
123
See [Writing CodeIgniter Documentation](./documentation.rst).
119
124
@@ -141,7 +146,7 @@ folder is also needed.
141
146
142
147
- Add an instruction what to do when upgrading.
143
148
- If you add new properties or changes default values in Config files, add the
144
-
changes in *"Project Files > Content Changes > Config"*.
149
+
changes in *"Project Files > Content Changes > Config"*.
145
150
146
151
### CSS
147
152
@@ -164,12 +169,19 @@ break with earlier versions of the framework.
164
169
165
170
#### Breaking Changes
166
171
167
-
In general, any change that would disrupt existing uses of the framework is considered a "Breaking Change" (BC) and will not be favorably considered. A few specific examples to pay attention to:
172
+
In general, any change that would disrupt existing uses of the framework is
173
+
considered a "Breaking Change" (BC) and will not be favorably considered. A few
174
+
specific examples to pay attention to:
168
175
169
-
1. New classes/properties/constants in `system` are acceptable, but anything in the `app` directory that will be used in `system` should be backwards-compatible.
170
-
2. Any changes to non-private methods must be backwards-compatible with the original definition.
171
-
3. Deleting non-private properties or methods without prior deprecation notices is frowned upon and will likely be closed.
172
-
4. Deleting or renaming public classes and interfaces, as well as those not marked as `@internal`, without prior deprecation notices or not providing fallback solutions will also not be favorably considered.
176
+
1. New classes/properties/constants in `system` are acceptable, but anything in
177
+
the `app` directory that will be used in `system` should be backwards-compatible.
178
+
2. Any changes to non-private methods must be backwards-compatible with the original
179
+
definition.
180
+
3. Deleting non-private properties or methods without prior deprecation notices
181
+
is frowned upon and will likely be closed.
182
+
4. Deleting or renaming public classes and interfaces, as well as those not marked
183
+
as `@internal`, without prior deprecation notices or not providing fallback
184
+
solutions will also not be favorably considered.
173
185
174
186
### Mergeability
175
187
@@ -184,48 +196,56 @@ working on your contribution.
184
196
185
197
### Branching
186
198
187
-
All bug fixes should be sent to the __"develop"__ branch, this is where the next bug fix version will be developed.
199
+
All bug fixes should be sent to the __"develop"__ branch, this is where the next
200
+
bug fix version will be developed.
188
201
189
202
PRs with any enhancement should be sent to next minor version branch, e.g. __"4.5"__
190
203
191
-
The __"master"__ branch will always contain the latest stable version and is kept clean so a "hotfix" (e.g. an
192
-
emergency security patch) can be applied to the "master" branch to create a new version, without worrying
193
-
about other features holding it up. Any sent to the "master" branch will be closed automatically.
204
+
The __"master"__ branch will always contain the latest stable version and is kept
205
+
clean so a "hotfix" (e.g. an emergency security patch) can be applied to the
206
+
"master" branch to create a new version, without worrying about other features
207
+
holding it up. Any sent to the "master" branch will be closed automatically.
194
208
195
209
If you have multiple changes to submit,
196
210
please place all changes into their own branch on your fork.
197
211
198
-
**One thing at a time:** A pull request should only contain one change. That does not mean only one commit,
199
-
but one change - however many commits it took. The reason for this is that if you change X and Y,
200
-
but send a pull request for both at the same time, we might really want X but disagree with Y,
201
-
meaning we cannot merge the request. Using the Git-Flow branching model you can create new
202
-
branches for both of these features and send two requests.
212
+
**One thing at a time:** A pull request should only contain one change. That does
213
+
not mean only one commit, but one change - however many commits it took. The reason
214
+
for this is that if you change X and Y, but send a pull request for both at the
215
+
same time, we might really want X but disagree with Y, meaning we cannot merge
216
+
the request. Using the Git-Flow branching model you can create new branches for
217
+
both of these features and send two requests.
203
218
204
-
A reminder: **please use separate branches for each of your PRs** - it will make it easier for you to keep
205
-
changes separate from each other and from whatever else you are doing with your repository!
219
+
A reminder: **please use separate branches for each of your PRs** - it will make
220
+
it easier for you to keep changes separate from each other and from whatever else
221
+
you are doing with your repository!
206
222
207
223
### Signing
208
224
209
225
You must [GPG-sign](./signing.md) your work, certifying that you either wrote the work or
210
-
otherwise have the right to pass it on to an open-source project. See [Developer's Certificate of Origin](./DCO.md).
226
+
otherwise have the right to pass it on to an open-source project. See
227
+
[Developer's Certificate of Origin](./DCO.md).
211
228
212
229
This is *not* just a "signed-off-by" commit, but instead, a digitally signed one.
213
230
214
231
See [Contribution signing](./signing.md) for details.
215
232
216
233
### Static Analysis on PHP code
217
234
218
-
We cannot, at all times, guarantee that all PHP code submitted on pull requests to be working well without
219
-
actually running the code. For this reason, we make use of two static analysis tools, [PHPStan][1]
220
-
and [Rector][2] to do the analysis for us.
235
+
We cannot, at all times, guarantee that all PHP code submitted on pull requests
236
+
to be working well without actually running the code. For this reason, we make
237
+
use of two static analysis tools, [PHPStan][1] and [Rector][2] to do the analysis
238
+
for us.
221
239
222
-
These tools have already been integrated into our CI/CD workflow to minimize unannounced bugs. Pull requests
223
-
are expected that their code will pass these two. In your local machine, you can manually run these tools
224
-
so that you can fix whatever errors that pop up with your submission.
240
+
These tools have already been integrated into our CI/CD workflow to minimize
241
+
unannounced bugs. Pull requests are expected that their code will pass these two.
242
+
In your local machine, you can manually run these tools so that you can fix
243
+
whatever errors that pop up with your submission.
225
244
226
245
#### PHPStan
227
246
228
-
PHPStan is expected to scan the entire framework by running this command in your terminal:
247
+
PHPStan is expected to scan the entire framework by running this command in your
248
+
terminal:
229
249
230
250
```console
231
251
vendor/bin/phpstan analyse
@@ -262,7 +282,10 @@ vendor/bin/rector process path/to/file
262
282
263
283
## How-to Guide
264
284
265
-
The best way to contribute is to fork the CodeIgniter4 repository, and "clone" that to your development area. That sounds like some jargon, but "forking" on GitHub means "making a copy of that repo to your account" and "cloning" means "copying that code to your environment so you can work on it".
285
+
The best way to contribute is to fork the CodeIgniter4 repository, and "clone"
286
+
that to your development area. That sounds like some jargon, but "forking" on
287
+
GitHub means "making a copy of that repo to your account" and "cloning" means
288
+
"copying that code to your environment so you can work on it".
266
289
267
290
1. Set up Git ([Windows](https://git-scm.com/download/win), [Mac](https://git-scm.com/download/mac), & [Linux](https://git-scm.com/download/linux)).
268
291
2. Go to the [CodeIgniter4 repository](https://github.com/codeigniter4/CodeIgniter4).
@@ -279,13 +302,18 @@ The best way to contribute is to fork the CodeIgniter4 repository, and "clone" t
279
302
- If your PR has any enhancement, create new branch from next minor version branch, e.g. __"4.5"__:
280
303
-`> git switch <next-minor-version-branch>`
281
304
-`> git switch -c <new-branch-name>`
282
-
7. Fix existing bugs on the [Issue tracker](https://github.com/codeigniter4/CodeIgniter4/issues) after confirming that no one else is working on them.
305
+
7. Fix existing bugs on the [Issue tracker](https://github.com/codeigniter4/CodeIgniter4/issues) after confirming that no one
306
+
else is working on them.
283
307
8.[Commit](https://help.github.com/en/desktop/contributing-to-projects/committing-and-reviewing-changes-to-your-project) the changed files in your contribution branch.
284
308
-`> git commit`
285
-
- Commit messages are expected to be descriptive of why and what you changed specifically. Commit messages like "Fixes #1234" would be asked by the reviewer to be revised. [Atomic commit](https://en.wikipedia.org/wiki/Atomic_commit#Atomic_commit_convention) is recommended. See [Contribution Workflow](./workflow.md#commit-messages) for details.
309
+
- Commit messages are expected to be descriptive of why and what you changed
310
+
specifically. Commit messages like "Fixes #1234" would be asked by the reviewer
311
+
to be revised. [Atomic commit](https://en.wikipedia.org/wiki/Atomic_commit#Atomic_commit_convention) is recommended. See
312
+
[Contribution Workflow](./workflow.md#commit-messages) for details.
286
313
9. If you have touched PHP code, run static analysis.
287
314
-`> composer analyze`
288
-
10. Run unit tests on the specific file you modified. If there are no existing tests yet, please create one.
315
+
10. Run unit tests on the specific file you modified. If there are no existing
- Make sure the tests pass to have a higher chance of merging.
291
319
11.[Push](https://docs.github.com/en/github/using-git/pushing-commits-to-a-remote-repository) your contribution branch to your fork.
@@ -295,9 +323,13 @@ The best way to contribute is to fork the CodeIgniter4 repository, and "clone" t
295
323
296
324
See [Contribution workflow](./workflow.md) for Git workflow details.
297
325
298
-
The codebase maintainers will now be alerted to the submission and someone from the team will respond. If your change fails to meet the guidelines, it will be rejected or feedback will be provided to help you improve it.
326
+
The codebase maintainers will now be alerted to the submission and someone from
327
+
the team will respond. If your change fails to meet the guidelines, it will be
328
+
rejected or feedback will be provided to help you improve it.
299
329
300
-
Once the maintainer handling your pull request is satisfied with it, they will approve the pull request and merge it into the "develop" branch. Your patch will now be part of the next release!
330
+
Once the maintainer handling your pull request is satisfied with it, they will
331
+
approve the pull request and merge it into the "develop" branch. Your patch will
Copy file name to clipboardExpand all lines: contributing/workflow.md
+28-21Lines changed: 28 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,8 @@ values for when you try these:
16
16
17
17
## Branching
18
18
19
-
- All bug fix PRs should be sent to the __"develop"__ branch, this is where the next bug fix version will be developed.
19
+
- All bug fix PRs should be sent to the __"develop"__ branch, this is where the
20
+
next bug fix version will be developed.
20
21
- PRs with any enhancement should be sent to next minor version branch, e.g. __"4.5"__
21
22
22
23
The "master" branch will always contain the latest stable
@@ -111,20 +112,22 @@ This local branch should be named appropriately, for instance
111
112
"fix/problem123" or "new/mind-reader". The slashes in these branch names
112
113
is optional, and implies a sort of namespacing if used.
113
114
114
-
- All bug fix PRs should be sent to the __"develop"__ branch, this is where the next bug fix version will be developed.
115
+
- All bug fix PRs should be sent to the __"develop"__ branch, this is where the
116
+
next bug fix version will be developed.
115
117
- PRs with any enhancement should be sent to next minor version branch, e.g. __"4.5"__
116
118
117
-
For instance, if you send a PR to __"develop"__ branch, make sure you are in the*develop* branch, and create a
118
-
new bugfix branch, based on *develop*, for a new feature you are
119
-
creating:
119
+
For instance, if you send a PR to __"develop"__ branch, make sure you are in the
120
+
*develop* branch, and create a new bugfix branch, based on *develop*, for a new
121
+
feature you are creating:
120
122
121
123
```console
122
124
> git switch develop
123
125
> git switch -c fix/problem123
124
126
```
125
127
126
-
If you send a PR with an enhancement, make sure you are in the *next minor version* branch,
127
-
and create a new feature branch, based on, e.g., __"4.5"__, for a new feature you are creating:
128
+
If you send a PR with an enhancement, make sure you are in the *next minor version*
129
+
branch, and create a new feature branch, based on, e.g., __"4.5"__, for a new
130
+
feature you are creating:
128
131
129
132
```console
130
133
> git switch 4.5
@@ -151,23 +154,24 @@ There are some references for writing good commit messages:
151
154
152
155
If there are intermediate commits that are not meaningful to the overall PR,
153
156
such as "Fix error on style guide", "Fix phpstan error", "Fix mistake in code",
154
-
and other related commits, you can squash your commits so that we can have a clean commit history.
155
-
But it is not a must.
157
+
and other related commits, you can squash your commits so that we can have a
158
+
clean commit history. But it is not a must.
156
159
157
160
### Commit Messages
158
161
159
-
Commit messages are important. They communicate the intent of a specific change, concisely.
160
-
They make it easier to review code, and to find out why a change was made
161
-
if the code history is examined later.
162
+
Commit messages are important. They communicate the intent of a specific change,
163
+
concisely. They make it easier to review code, and to find out why a change was
164
+
made if the code history is examined later.
162
165
163
166
The audience for your commit messages will be the codebase maintainers,
164
167
any code reviewers, and debuggers trying to figure out when a bug might
165
168
have been introduced.
166
169
167
170
Make your commit messages meaningful.
168
171
169
-
Commit messages are expected to be descriptive of **why** and what you changed specifically.
170
-
Commit messages like "Fixes #1234" would be asked by the reviewer to be revised.
172
+
Commit messages are expected to be descriptive of **why** and what you changed
173
+
specifically. Commit messages like "Fixes #1234" would be asked by the reviewer
174
+
to be revised.
171
175
172
176
You can have as many commits in a branch as you need to "get it right".
173
177
For instance, to commit your work from a debugging session:
@@ -185,7 +189,8 @@ Just make sure that your commits in a feature branch are all related.
185
189
186
190
### GPG-Signing Old Commits
187
191
188
-
Any developer can forget GPG-signing their commits with the option `-S`, like `git commit -S -m 'Signed GPG'`. In such a case, all you need to do is the following:
192
+
Any developer can forget GPG-signing their commits with the option `-S`, like
193
+
`git commit -S -m 'Signed GPG'`. In such a case, all you need to do is the following:
189
194
190
195
Latest commit only:
191
196
```console
@@ -267,16 +272,16 @@ On GitHub, you propose your changes one feature branch at a time, by
267
272
switching to the branch you wish to contribute, and then clicking on
268
273
"New pull request".
269
274
270
-
Make sure the pull request is for the shared __"develop"__ or next minor version branch, e.g. __"4.5"__, or it
271
-
may be rejected.
275
+
Make sure the pull request is for the shared __"develop"__ or next minor version
276
+
branch, e.g. __"4.5"__, or it may be rejected.
272
277
273
278
Make sure that the PR title is helpful for the maintainers and other
274
279
developers. Add any comments appropriate, for instance asking for
275
280
review.
276
281
277
282
> **Note**
278
-
> If you do not provide a title or description for your PR, the odds of it being summarily rejected
279
-
rise astronomically.
283
+
> If you do not provide a title or description for your PR, the odds of it being
284
+
> summarily rejected rise astronomically.
280
285
281
286
When your PR is submitted, a continuous integration task will be
282
287
triggered, running all the unit tests as well as any other checking we
@@ -306,9 +311,11 @@ And if your PRs have the breaking changes, label the following label:
306
311
307
312
## Updating Your Branch
308
313
309
-
If you are asked for changes in the review, commit the fix in your branch and push it to GitHub again.
314
+
If you are asked for changes in the review, commit the fix in your branch and
315
+
push it to GitHub again.
310
316
311
-
If the __"develop"__ or next minor version branch, e.g. __"4.5"__, progresses and conflicts arise that prevent merging, or if you are asked to *rebase*,
317
+
If the __"develop"__ or next minor version branch, e.g. __"4.5"__, progresses
318
+
and conflicts arise that prevent merging, or if you are asked to *rebase*,
0 commit comments