Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 22:52
    jrfnl commented #2387
  • Jan 31 2019 22:41
    valeryan commented #2386
  • Jan 31 2019 22:40
    valeryan commented #2386
  • Jan 31 2019 22:40
    valeryan commented #2386
  • Jan 31 2019 22:17
    gsherwood commented #2387
  • Jan 31 2019 22:14
    gsherwood milestoned #2387
  • Jan 31 2019 22:13
    gsherwood labeled #2386
  • Jan 31 2019 22:13
    gsherwood commented #2386
  • Jan 31 2019 22:05
    gsherwood milestoned #2388
  • Jan 31 2019 22:03
    gsherwood labeled #2394
  • Jan 31 2019 22:02
    gsherwood commented #2394
  • Jan 31 2019 22:02
    gsherwood closed #2394
  • Jan 31 2019 22:02

    gsherwood on master

    Fixed docblocks Because customā€¦ (compare)

  • Jan 31 2019 22:02
    gsherwood milestoned #2394
  • Jan 31 2019 16:50
  • Jan 31 2019 16:00
    SteepDevs starred squizlabs/PHP_CodeSniffer
  • Jan 31 2019 15:22
  • Jan 31 2019 14:39
    sebastiaanluca commented #2304
  • Jan 31 2019 14:38
    sebastiaanluca commented #2304
  • Jan 31 2019 13:09
    rlauenroth starred squizlabs/PHP_CodeSniffer
Ricardo Puerto
@djibarian
of course if I add brackets to the if the error disappears
Marco Polichetti
@gremo
Hi dudes. I'm trying to better refine my phpcs.xml coding standard, but I have a problem, can't relative exclude some directories
<file>./src/</file>
<exclude-pattern>var/*</exclude-pattern>
<exclude-pattern >vendor/*</exclude-pattern>
The above is working...
But this is not working:
<file>./src/</file>
<exclude-pattern type="relative">^./var/*</exclude-pattern>
<exclude-pattern type="relative">^./vendor/*</exclude-pattern>
Anyone knows why?
Chetan PrajapatišŸ‡®šŸ‡³
@iamchetanp_twitter
I am getthing this error on VSCode phpcs: The "WordPress" coding standard is not installed. Please review your configuration an try again.
Chetan PrajapatišŸ‡®šŸ‡³
@iamchetanp_twitter
This has been fixed! :)
Dmitry Zelonkin
@dmitry.zelonkin_gitlab
Hello guys! Is it possible to detect unused php imports?
Faithu
@Faithu
hello
i don't suppose anyone is active to help me?
abyong123
@abyong123
anybody active?
Glen
@glen-84
@jrfnl Hi Juliette. Do you know why I would get ERROR: Referenced sniff "PHPCS23Utils" does not exist when running phpcs --standard=PHPCompatibility?
@gsherwood Hi Greg. Has Gitter been disconnected from the PHPCS repo? The activity on the right is outdated.
Glen
@glen-84
nvm Juliette, I had to switch to the master branch (wasn't mentioned in the README).
Juliette
@jrfnl
@glen-84 Ah yes, the README has not been updated for the changes in the upcoming 10.0.0 release yet, in an attempt to prevent confusing people terribly with install instructions which wouldn't work (yet).
Generally speaking using a tagged release will always be best.
If you prefer to use bleeding edge develop, I can help you get that working, but I'd need a little more information on how you've installed and are running PHPCS/PHPCompatibility (Phar, clones, Composer).
Glen
@glen-84
@jrfnl Does the current release include some support for PHP 8, or is that only in 10.x?
Juliette
@jrfnl
@glen-84 9.3.5 has hardly anything on PHP 8, maybe a few small things which were deprecated in PHP 7.x and for which it was already announced that they would be removed in PHP 8.
So for checking anything PHP 8 related, 10.0 (currently develop) would be your best bet and yes, 10 already contains a huge amount of new checks related to PHP 8.
Glen
@glen-84
@jrfnl Then I wouldn't mind some assistance with setting this up :slight_smile:. I have a global composer installation of PHPCS, and a clone of PHPCompat. When I'm on the develop branch, I see the error above. Is there a simple way to fix that?
Juliette
@jrfnl

@glen-84 Sort of, though having a mixed installation like that makes it slightly more awkward. Basically PHPCompat adds a new dependency and you're currently missing that dependency.
There are several ways to solve it though:

  1. On the git clone of PHPCompat, run composer install --no-dev, then use the phpcs command in the vendor/bin/ directory of PHPCompat to run the PHPCompat checks. This will only be useful if you run just and only PHPCompatibility over code.
  2. Instead of using the git clone of PHPCompat, install it globally with Composer using composer global phpcompatibility/php-compatibility:"dev-develop". You might need to make sure that your global Composer config file allows for 'minimum-stability': 'dev'. You may also want to wait until PR PHPCompatibility/PHPCompatibility#1245 has been merged to prevent a possible exception being thrown (merge expected later today). PHPCompat + PHPCSUtils should automatically register themselves with the Composer globally installed PHPCS instance as the DealerDirect Composer PHPCS plugin will be installed as well.
  3. Last option: clone PHPCSUtils as well - for now, check out the 1.0.0-alpha3 tag and register the location of PHPCSUtils with the Composer global PHPCS instance via the installed_paths config.

Does that help ?

Oops - forgetting the link to PHPCSUtils: https://github.com/PHPCSStandards/PHPCSUtils
Option 2 should be most stable, though as you are using develop, you will need to run composer global update phpcompatibility/php-compatibility --with-dependencies regularly.
Glen
@glen-84
@jrfnl I'll try #1 first. Thanks so much for the detailed instructions, and for all the work that you do.
Juliette
@jrfnl
@glen-84 You're welcome! Let me know how you get on.
Glen
@glen-84
It works, thanks again. :slight_smile:
Juliette
@jrfnl
@glen-84 Thanks for letting me know! Hope you like the new and improved PHPCompatibility. Please let me know if you find any bugs.
dstrisma
@dstrisma
Hello :) Can phpcbf not fix lowercase constants?
vladicidev
@vladicidev
Can anyone explain why \r\n line endings are reported as ERRORs with the following message: End of line character is invalid; expected "\n" but found "\r\n"
The rule is defined here: https://github.com/squizlabs/PHP_CodeSniffer/blob/2ecd990f9f19075632773b8c75cbec013eef74bf/src/Standards/Generic/Sniffs/Files/LineEndingsSniff.php
The question is why the \n line ending character is considered as the only "correct" one.
Greg Sherwood
@gsherwood
@vladicidev Because the coding standard you are checking with has decided to standardise on them, probably based on a heavy use of unix tooling over windows, and the general preference of the developers working on the project.
vladicidev
@vladicidev
Hi @gsherwood, thanks for replying me. I see what you mean and I guess the question should be addressed to PSR then, just don't get it why this is a requirement when it doesn't lead to any issues.
Michael Cordover
@mjec
Hi folks! At $dayjob we're about to embark on a phpcs upgrade, including writing some new sniffs, but we've got a bit of flexibility on when to do this. I notice there's a phpcs 4.0 branch -- what's the status of that? I'm not looking to hold anyone to a timeline, but it'd be good to know if that's roughly "right around the corner" or if it's more of a "check back in 2022" thing
Greg Sherwood
@gsherwood
@mjec Closer to 2022 than "right around the corner". I wouldn't wait for it, but worth keeping an eye on the changelog to see what's going in: https://github.com/squizlabs/PHP_CodeSniffer/blob/4.0/CHANGELOG.md
Michael Cordover
@mjec
Ah excellent, thanks Greg!
abyong123
@abyong123
anybody here who can help me?
Doug
@OdinsHat
Is there an existing rule out of the existing standards that checks for docblocks? So I don't have to create my own sniffer, etc?
Juliette
@jrfnl
@OdinsHat Both the PEAR standard as well as the Squiz standard contain various docblock related sniffs in the Commenting category and there is also the Generic.Commenting.DocComment sniff.
Doug
@OdinsHat
Ah brilliant - thank you @jrfnl :) Much appreciated.