owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.38k stars 2.05k forks source link

using two different code-standard-checkers #31281

Open individual-it opened 6 years ago

individual-it commented 6 years ago

currently we are using

  1. phpcs with https://github.com/owncloud/core/blob/master/phpcs.xml as config and
  2. php cs fixer with https://github.com/owncloud/core/blob/master/.php_cs as config

phpcs is mentioned in the documentation https://doc.owncloud.org/server/10.0/developer_manual/general/codingguidelines.html#php

feel like we should decide for one of the tools and get rid of the other one

CC @DeepDiver1975 @patrickjahns @phil-davis

DeepDiver1975 commented 6 years ago

I had a quick chat with @patrickjahns about this - projects out there seem to use both ... we need to check for the reasoning.

But yes - documentations need to be adopted - THX for the pointer

ownclouders commented 6 years ago

GitMate.io thinks possibly related issues are https://github.com/owncloud/core/issues/22420 ([Code checker] Check for missing index names), https://github.com/owncloud/core/issues/19946 (Inconsistent use of different languages), https://github.com/owncloud/core/issues/16673 (Two different Strict-Transport-Security recommendations), https://github.com/owncloud/core/issues/25521 (Code Integrity check fails for standard files), and https://github.com/owncloud/core/pull/30130 (Fix code checker "class not found").

phil-davis commented 6 years ago

I already submitted a few PRs for phpcs to fix things I found with its docBlock parser. Not sure if that is a recommendation for it (community contributions are accepted quickly) or against it (it is not perfect).

phil-davis commented 6 years ago

Bit of discussion here: https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/3459

php_cs_fixer has only things that it can fix automatically.

phpcs is a general "linter" that can report on other code-standard things that it may not be capable of fixing.

As long as we do not require conflictings code standards, then actually we can use both. php_cs_fixer might be able to automatically fix some things that phpcs might just report.

patrickjahns commented 6 years ago

The upside of using codesniffer is also the excellent integration into PHPStorms IDE.

As for using both tools at once - https://github.com/Symplify/EasyCodingStandard tries to abstract the need for both and provide easier configuration - maybe worth having a look?

mmattel commented 6 years ago

Already filed an issue in documentation regarding php-cs-fixer: https://github.com/owncloud/documentation/issues/4064

ownclouders commented 6 years ago

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

phil-davis commented 6 years ago

More discussion and sorting-out still pending.

DeepDiver1975 commented 6 years ago

there will be even more tool which can/shall be added: PHPStan as example ...

keradus commented 5 years ago

The upside of using codesniffer is also the excellent integration into PHPStorms IDE.

PHPStorms IDE now supports PHP CS Fixer out of the box

TomasVotruba commented 5 years ago

Hi, EasyCodingStandard author here. I've just noticed this issues while googling

Let me know if you need to squash 2 tools to one :)