You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-dev@logging.apache.org by Ivan Habunek <iv...@gmail.com> on 2012/06/13 10:04:14 UTC

Proposal: adopt the PSR-2 coding standard

The PSR coding standards [1] have recently been approved by the PHP
Framework Interop Group  (ex PHP Standards Working Group) [2].

I have read the standards, they seem well constructed, and they make
sense to me.

PSR-0 - Deals with namespaces, so it does not affect the project at this point.
PSR-1 - Sets basic coding standards. log4php code is already compliant
with this standard.
PSR-2 - Extends PSR-1 with much more detailed rules. log4php is
currently not compliant.

There are not that many changes we need to make to be compliant with
PSR-2. The larger ones would be:
- indent using 4 spaces (currently tabs)
- opening braces for classes and methods go on the next line (currently inline)
- lines must end with unix LF (currently undefined - mixed LF and CR/LF)

I think a decent coding standard would be good for this project, and
make any contributions easier. Therefore I propose that we adopt these
standards, starting with the next release (2.3.0). I also volunteer to
do the work.

What say you?

Regards,
Ivan

[1] https://github.com/php-fig/fig-standards/tree/master/accepted
[2] https://groups.google.com/forum/#!forum/php-standards

Re: Proposal: adopt the PSR-2 coding standard

Posted by Florian Semm <fl...@gmx.de>.
Am 13.06.2012 10:04, schrieb Ivan Habunek:
> The PSR coding standards [1] have recently been approved by the PHP
> Framework Interop Group  (ex PHP Standards Working Group) [2].
>
> I have read the standards, they seem well constructed, and they make
> sense to me.
>
> PSR-0 - Deals with namespaces, so it does not affect the project at this point.
> PSR-1 - Sets basic coding standards. log4php code is already compliant
> with this standard.
> PSR-2 - Extends PSR-1 with much more detailed rules. log4php is
> currently not compliant.
>
> There are not that many changes we need to make to be compliant with
> PSR-2. The larger ones would be:
> - indent using 4 spaces (currently tabs)
> - opening braces for classes and methods go on the next line (currently inline)
> - lines must end with unix LF (currently undefined - mixed LF and CR/LF)
> I think a decent coding standard would be good for this project, and
> make any contributions easier. Therefore I propose that we adopt these
> standards, starting with the next release (2.3.0). I also volunteer to
> do the work.

I think we should use a coding-standard what concrete standard doesn't 
matter.

But an adaption of the PSR-2 with inline braces would be nice. ;)

> What say you?
>
> Regards,
> Ivan
>
> [1] https://github.com/php-fig/fig-standards/tree/master/accepted
> [2] https://groups.google.com/forum/#!forum/php-standards

Sorry for the late answer.

Regards,

Florian


Re: Proposal: adopt the PSR-2 coding standard

Posted by Christian Grobmeier <gr...@gmail.com>.
On Fri, Jun 15, 2012 at 2:44 PM, Ivan Habunek <iv...@gmail.com> wrote:
> Since the reception is a bit weak, I think we can postpone this
> decision for after 2.3 release. Maybe even for 3.0 which will include
> namespaces, and as such requires a major restructuring anyway.

After you explained and I thought twice, I will not object against
this change. Even when I would love to keep the curly braces where
they belong (heck, on the same line!) I am convinced that applying a
"standard" is good.

if nobody else speaks up and objects i think you can simply go and
start with it, if you like.

> Regardless, I wish to improve the standard for the next release and
> find a way to check them automatically. Therefore, I'm working on a
> ruleset for PHP_CodeSniffer [1] which we can add to our build script.
> I'll open an issue to work on this.

Thanks!
Cheers
Christian

>
> Regards,
> Ivan
>
> [1] http://pear.php.net/package/PHP_CodeSniffer
>
> On 13 June 2012 13:09, Christian Grobmeier <gr...@gmail.com> wrote:
>> ugh inline brackets??
>> This is pretty much C....
>>
>> well if anybody else wants this... I am a huge fan of inline brackets
>> but of course I will follow the majority.
>>
>> Cheers
>>
>> On Wed, Jun 13, 2012 at 10:04 AM, Ivan Habunek <iv...@gmail.com> wrote:
>>> The PSR coding standards [1] have recently been approved by the PHP
>>> Framework Interop Group  (ex PHP Standards Working Group) [2].
>>>
>>> I have read the standards, they seem well constructed, and they make
>>> sense to me.
>>>
>>> PSR-0 - Deals with namespaces, so it does not affect the project at this point.
>>> PSR-1 - Sets basic coding standards. log4php code is already compliant
>>> with this standard.
>>> PSR-2 - Extends PSR-1 with much more detailed rules. log4php is
>>> currently not compliant.
>>>
>>> There are not that many changes we need to make to be compliant with
>>> PSR-2. The larger ones would be:
>>> - indent using 4 spaces (currently tabs)
>>> - opening braces for classes and methods go on the next line (currently inline)
>>> - lines must end with unix LF (currently undefined - mixed LF and CR/LF)
>>>
>>> I think a decent coding standard would be good for this project, and
>>> make any contributions easier. Therefore I propose that we adopt these
>>> standards, starting with the next release (2.3.0). I also volunteer to
>>> do the work.
>>>
>>> What say you?
>>>
>>> Regards,
>>> Ivan
>>>
>>> [1] https://github.com/php-fig/fig-standards/tree/master/accepted
>>> [2] https://groups.google.com/forum/#!forum/php-standards
>>
>>
>>
>> --
>> http://www.grobmeier.de
>> https://www.timeandbill.de



-- 
http://www.grobmeier.de
https://www.timeandbill.de

Re: Proposal: adopt the PSR-2 coding standard

Posted by Ivan Habunek <iv...@gmail.com>.
Since the reception is a bit weak, I think we can postpone this
decision for after 2.3 release. Maybe even for 3.0 which will include
namespaces, and as such requires a major restructuring anyway.

Regardless, I wish to improve the standard for the next release and
find a way to check them automatically. Therefore, I'm working on a
ruleset for PHP_CodeSniffer [1] which we can add to our build script.
I'll open an issue to work on this.

Regards,
Ivan

[1] http://pear.php.net/package/PHP_CodeSniffer

On 13 June 2012 13:09, Christian Grobmeier <gr...@gmail.com> wrote:
> ugh inline brackets??
> This is pretty much C....
>
> well if anybody else wants this... I am a huge fan of inline brackets
> but of course I will follow the majority.
>
> Cheers
>
> On Wed, Jun 13, 2012 at 10:04 AM, Ivan Habunek <iv...@gmail.com> wrote:
>> The PSR coding standards [1] have recently been approved by the PHP
>> Framework Interop Group  (ex PHP Standards Working Group) [2].
>>
>> I have read the standards, they seem well constructed, and they make
>> sense to me.
>>
>> PSR-0 - Deals with namespaces, so it does not affect the project at this point.
>> PSR-1 - Sets basic coding standards. log4php code is already compliant
>> with this standard.
>> PSR-2 - Extends PSR-1 with much more detailed rules. log4php is
>> currently not compliant.
>>
>> There are not that many changes we need to make to be compliant with
>> PSR-2. The larger ones would be:
>> - indent using 4 spaces (currently tabs)
>> - opening braces for classes and methods go on the next line (currently inline)
>> - lines must end with unix LF (currently undefined - mixed LF and CR/LF)
>>
>> I think a decent coding standard would be good for this project, and
>> make any contributions easier. Therefore I propose that we adopt these
>> standards, starting with the next release (2.3.0). I also volunteer to
>> do the work.
>>
>> What say you?
>>
>> Regards,
>> Ivan
>>
>> [1] https://github.com/php-fig/fig-standards/tree/master/accepted
>> [2] https://groups.google.com/forum/#!forum/php-standards
>
>
>
> --
> http://www.grobmeier.de
> https://www.timeandbill.de

Re: Proposal: adopt the PSR-2 coding standard

Posted by Christian Grobmeier <gr...@gmail.com>.
ugh inline brackets??
This is pretty much C....

well if anybody else wants this... I am a huge fan of inline brackets
but of course I will follow the majority.

Cheers

On Wed, Jun 13, 2012 at 10:04 AM, Ivan Habunek <iv...@gmail.com> wrote:
> The PSR coding standards [1] have recently been approved by the PHP
> Framework Interop Group  (ex PHP Standards Working Group) [2].
>
> I have read the standards, they seem well constructed, and they make
> sense to me.
>
> PSR-0 - Deals with namespaces, so it does not affect the project at this point.
> PSR-1 - Sets basic coding standards. log4php code is already compliant
> with this standard.
> PSR-2 - Extends PSR-1 with much more detailed rules. log4php is
> currently not compliant.
>
> There are not that many changes we need to make to be compliant with
> PSR-2. The larger ones would be:
> - indent using 4 spaces (currently tabs)
> - opening braces for classes and methods go on the next line (currently inline)
> - lines must end with unix LF (currently undefined - mixed LF and CR/LF)
>
> I think a decent coding standard would be good for this project, and
> make any contributions easier. Therefore I propose that we adopt these
> standards, starting with the next release (2.3.0). I also volunteer to
> do the work.
>
> What say you?
>
> Regards,
> Ivan
>
> [1] https://github.com/php-fig/fig-standards/tree/master/accepted
> [2] https://groups.google.com/forum/#!forum/php-standards



-- 
http://www.grobmeier.de
https://www.timeandbill.de