Update & restructure contribution guide.

Signed-off-by:Master Yoda <jim_parry@bcit.ca>
This commit is contained in:
Master Yoda 2016-05-26 23:58:38 -07:00
parent 1a635ab3c9
commit 4700c81c3c
8 changed files with 176 additions and 238 deletions

View File

@ -197,7 +197,7 @@ class App extends BaseConfig
|--------------------------------------------------------------------------
| The Debug Toolbar provides a way to see information about the performance
| and state of your application during that page display. By default it will
| be displayed under production environments, and will only display if
| NOT be displayed under production environments, and will only display if
| CI_DEBIG is true, since if it's not, there's not much to display anyway.
*/
public $toolbarEnabled = (ENVIRONMENT != 'production' && CI_DEBUG);

View File

@ -9,8 +9,8 @@
</transformer>
<files>
<directory>./system</directory>
<ignore>vendor/*</ignore>
<ignore>test/*</ignore>
<ignore>./vendor/*</ignore>
<ignore>./tests/*</ignore>
<ignore>Kint/*</ignore>
</files>

View File

@ -9,51 +9,3 @@ Release Date: Not Released
Rewrite
Version 3.0.6
=============
Release Date: Mar 21, 2016
Maintenance update.
Version 3.0.0
=============
Release Date: April 24, 2015
Initial release of V3
Version 2.2.6
=============
Release Date: Oct 31, 2015
Last release for V2. EOL.
Version 2.0.0
=============
Release Date: January 28, 2011
First release of V2
Version 1.7.2
=============
Release Date: September 11, 2009
Last release in the V1 line.
Version 1.2
===========
Release Date: March 21, 2006
First non-beta release
Version Beta 1.0
================
Release Date: February 28, 2006
First publicly released version.

View File

@ -101,102 +101,3 @@ create these with the following tab triggers::
SubSubSubSubSection (!)
"""""""""""""""""""""""
********************
Method Documentation
********************
When documenting class methods for third party developers, Sphinx provides
directives to assist and keep things simple.
For example, consider the following ReST:
.. code-block:: rst
.. php:class:: Some_class
.. php:method:: some_method ( $foo [, $bar [, $bat]])
This function will perform some action. The ``$bar`` array must contain
a something and something else, and along with ``$bat`` is an optional
parameter.
:param int $foo: the foo id to do something in
:param mixed $bar: A data array that must contain a something and something else
:param bool $bat: whether or not to do something
:returns: FALSE on failure, TRUE if successful
:rtype: bool
::
$this->load->library('some_class');
$bar = array(
'something' => 'Here is this parameter!',
'something_else' => 42
);
$bat = $this->some_class->should_do_something();
if ($this->some_class->some_method(4, $bar, $bat) === FALSE)
{
show_error('An Error Occurred Doing Some Method');
}
.. note:: Here is something that you should be aware of when using some_method().
For real.
See also :meth:`Some_class::should_do_something`
.. php:method:: should_do_something()
:returns: Whether or not something should be done
:rtype: bool
It creates the following display:
.. php:class:: Some_class
.. php:method:: some_method ( $foo [, $bar [, $bat]])
This function will perform some action. The ``$bar`` array must contain
a something and something else, and along with ``$bat`` is an optional
parameter.
:param int $foo: the foo id to do something in
:param mixed $bar: A data array that must contain a something and something else
:param bool $bat: whether or not to do something
:returns: FALSE on failure, TRUE if successful
:rtype: bool
::
$this->load->library('some_class');
$bar = array(
'something' => 'Here is this parameter!',
'something_else' => 42
);
$bat = $this->some_class->should_do_something();
if ($this->some_class->some_method(4, $bar, $bat) === FALSE)
{
show_error('An Error Occurred Doing Some Method');
}
.. note:: Here is something that you should be aware of when using some_method().
For real.
See also :meth:`Some_class::should_do_something`
.. php:method:: should_do_something()
:returns: Whether or not something should be done
:rtype: bool

View File

@ -0,0 +1,113 @@
=======================
Contribution Guidelines
=======================
Your Pull Requests (PRs) need to meet our guidelines. If a PR fails
to pass these guidelines, it will be declined and you will need to re-submit
when youve made the changes. This might sound a bit tough, but it is required
for us to maintain quality of the code-base.
PHP Style
=========
All code must conform to our `Style Guide
<./styleguide.html>`_, which is
essentially the `Allman indent style
<https://en.wikipedia.org/wiki/Indent_style#Allman_style>`_, with
elaboration on naming and readable operators.
This makes certain that all code is the same format as the
existing code and means it will be as readable as possible.
Our Style Guide is similar to PSR-1 and PSR-2, from PHP-FIG,
but not necessarily the same or compatible.
Unit Testing
============
Unit testing is expected for all CodeIgniter components.
We use PHPunit, and run unit tests using travis-ci
for each PR submitted or changed.
In the CodeIgniter project, there is a ``tests`` folder, with a structure that
parallels that of ``system``.
The normal practice would be to have a unit test class for each of the classes
in ``system``, named appropriately. For instance, the ``BananaTest``
class would test the ``Banana`` class. There will be occasions when
it is more convenient to have separate classes to test different functionality
of a single CodeIgniter component.
See the `PHPUnit website <https://phpunit.de/>`_ for more information.
PHPdoc Comments
===============
Source code should be commented using PHPdoc comments blocks.
Thie means implementation comments to explain potentially confusing sections
of code, and documentation comments before each public or protected
class/interface/trait, method and variable.
See the `phpDocumentor website <https://phpdoc.org/>`_ for more information.
We use ``phpDocumentor2`` to generate the API documentation for the
framework, with configuration details in ``phpdoc.dist.xml`` in the project
root.
Documentation
=============
The User Guide is an essential component of the CodeIgniter framework.
Each framework component or group of components needs a corresponding
section in the User Guide. Some of the more fundamental components will
show up in more than one place.
Change Log
==========
The change-log, in the user guide root, needs to be kept up-to-date.
See the `CodeIgniter 3 change log
<https://github.com/bcit-ci/CodeIgniter/blob/develop/user_guide_src/source/changelog.rst>`_
for an example.
PHP Compatibility
=================
CodeIgniter4 requires PHP 7.
There is currently an issue with phpDocumentor and PHP7 ...
phpDocumentor2 does not properly recognize the hinted return type in PHP7.
In order to generate phpdocs for CI4, the return types in method signatures
have been commented out for now. They can be restored using a global search
& replace once phpDocumentor has addressed their issue.
Desired: ``function banana(): fruit``
Workaround: ``function banana()//: fruit``
Or, for an interface...
Desired: ``function banana(): fruit;``
Workaround: ``function banana();//: fruit;``
Backwards Compatibility
=======================
Generally, we aim to maintain backwards compatibility between minor
versions of the framework. Any changes that break compatibility need
a good reason to do so, and need to be pointed out in the
`Upgrading <../installation/upgrading.html>`_ guide.
CodeIgniter4 itself represents a significant backwards compatibility break
with earlier versions of the framework.
Mergeability
============
Your PRs need to be mergeable before they will be considered.
We suggest that you synchronize your repository's ``develop`` branch with
that in the main repository before submitting a PR.
You will need to resolve any merge conflicts introduced by changes
incorporated since you started working on your contribution.

View File

@ -3,16 +3,18 @@ Contributing to CodeIgniter
###########################
.. toctree::
:titlesonly:
:titlesonly:
../documentation/index
PHP Style Guide <styleguide>
../DCO
guidelines
process
documentation
PHP Style Guide <styleguide>
../DCO
CodeIgniter is a community driven project and accepts contributions of code
and documentation from the community. These contributions are made in the form
of Issues or `Pull Requests <https://help.github.com/articles/using-pull-requests/>`_
on the `CodeIgniter repository <https://github.com/bcit-ci/CodeIgniter>`_ on GitHub.
on the `CodeIgniter4 repository <https://github.com/bcit-ci/CodeIgniter4>`_ on GitHub.
Issues are a quick way to point out a bug. If you find a bug or documentation
error in CodeIgniter then please check a few things first:
@ -72,86 +74,3 @@ The issue report information above should be part of that.
If your issue report can describe the steps to reproduce the problem, that is great.
If you can include a unit test that reproduces the problem, that is even better, as it gives whoever is fixing
it a clearer target!
**********
Guidelines
**********
Before we look into how, here are the guidelines. If your Pull Requests fail
to pass these guidelines it will be declined and you will need to re-submit
when youve made the changes. This might sound a bit tough, but it is required
for us to maintain quality of the code-base.
PHP Style
=========
All code must meet the `Style Guide
<./styleguide.html>`_, which is
essentially the `Allman indent style
<https://en.wikipedia.org/wiki/Indent_style#Allman_style>`_, underscores and
readable operators. This makes certain that all code is the same format as the
existing code and means it will be as readable as possible.
Documentation
=============
If you change anything that requires a change to documentation then you will
need to add it. New classes, methods, parameters, changing default values, etc
are all things that will require a change to documentation. The change-log
must also be updated for every change. Also PHPDoc blocks must be maintained.
Compatibility
=============
CodeIgniter4 requires PHP 7.
Branching
=========
CodeIgniter uses the `Git-Flow
<http://nvie.com/posts/a-successful-git-branching-model/>`_ branching model
which requires all pull requests to be sent to the "develop" branch. This is
where the next planned version will be developed. The "master" branch will
always contain the latest stable version and is kept clean so a "hotfix" (e.g:
an emergency security patch) can be applied to master to create a new version,
without worrying about other features holding it up. For this reason all
commits need to be made to "develop" and any sent to "master" will be closed
automatically. If you have multiple changes to submit, please place all
changes into their own branch on your fork.
One thing at a time: A pull request should only contain one change. That does
not mean only one commit, but one change - however many commits it took. The
reason for this is that if you change X and Y but send a pull request for both
at the same time, we might really want X but disagree with Y, meaning we
cannot merge the request. Using the Git-Flow branching model you can create
new branches for both of these features and send two requests.
Signing
=======
You must sign your work, certifying that you either wrote the work or
otherwise have the right to pass it on to an open source project. git makes
this trivial as you merely have to use `--signoff` on your commits to your
CodeIgniter fork.
.. code-block:: bash
git commit --signoff
or simply
.. code-block:: bash
git commit -s
This will sign your commits with the information setup in your git config, e.g.
Signed-off-by: John Q Public <john.public@example.com>
If you are using Tower there is a "Sign-Off" checkbox in the commit window. You
could even alias git commit to use the -s flag so you dont have to think about
it.
By signing your work in this manner, you certify to a "Developer's Certificate
of Origin". The current version of this certificate is in the :doc:`/DCO` file
in the root of this documentation.

View File

@ -0,0 +1,53 @@
====================
Contribution Process
====================
Branching
=========
CodeIgniter uses the `Git-Flow
<http://nvie.com/posts/a-successful-git-branching-model/>`_ branching model
which requires all pull requests to be sent to the "develop" branch. This is
where the next planned version will be developed. The "master" branch will
always contain the latest stable version and is kept clean so a "hotfix" (e.g:
an emergency security patch) can be applied to master to create a new version,
without worrying about other features holding it up. For this reason all
commits need to be made to "develop" and any sent to "master" will be closed
automatically. If you have multiple changes to submit, please place all
changes into their own branch on your fork.
One thing at a time: A pull request should only contain one change. That does
not mean only one commit, but one change - however many commits it took. The
reason for this is that if you change X and Y but send a pull request for both
at the same time, we might really want X but disagree with Y, meaning we
cannot merge the request. Using the Git-Flow branching model you can create
new branches for both of these features and send two requests.
Signing
=======
You must sign your work, certifying that you either wrote the work or
otherwise have the right to pass it on to an open source project. git makes
this easy as you merely have to use `--signoff` on your commits to your
CodeIgniter fork.
.. code-block:: bash
git commit --signoff
or simply
.. code-block:: bash
git commit -s
This will sign your commits with the information setup in your git config, e.g.
Signed-off-by: John Q Public <john.public@example.com>
If you are using Tower there is a "Sign-Off" checkbox in the commit window. You
could even alias git commit to use the -s flag so you dont have to think about
it.
By signing your work in this manner, you certify to a "Developer's Certificate
of Origin". The current version of this certificate is in the :doc:`/DCO` file
in the root of this documentation.