squizlabs

squizlabs

Member Since 10 years ago

Sydney, Australia

Experience Points
0
follower
Lessons Completed
0
follow
Best Reply Awards
14
repos
Activity
Jan
24
6 hours ago
Jan
23
1 day ago
started
started time in 16 hours ago
pull request

WinterSilence pull request squizlabs/PHP_CodeSniffer

WinterSilence
WinterSilence

Update Runner.php

  1. Fix @return
  2. Add optional parameter to run* methods to pass custom configuration settings. (to integrate into web/http applications)
pull request

WinterSilence pull request squizlabs/PHP_CodeSniffer

WinterSilence
WinterSilence

FunctionCommentThrowTagSniff: added support to multiple class definition in @throws

Adds support to multiple definition like as @throws Exception|Exception2

pull request

WinterSilence pull request squizlabs/PHP_CodeSniffer

WinterSilence
WinterSilence

Update example in class `AbstractScopeSniff`

started
started time in 22 hours ago
Activity icon
issue

jagirbahesh issue comment squizlabs/PHP_CodeSniffer

jagirbahesh
jagirbahesh

Help: Getting PHPCS Response ERROR: Referenced sniff "PHPCSUtils" does not exist

I've installed codesniffer with homebrew on a mac using the guide here: https://luminfire.com/2017/03/01/wordpress-php-codesniffer-favorite-editor/

But I'm getting the following error in dev tools on atom:

PHPCS Response ERROR: Referenced sniff "PHPCSUtils" does not exist

I don't recognize PHPCSUtils from any of the process or configuration. Any thoughts / ideas?

jagirbahesh
jagirbahesh

@CrowdForge Based on that tutorial, you would be using a git clone and based on the error, you seem to be using the develop version of the WordPress Coding Standards. Either switch to master or, better yet, use Composer to install WordPressCS to make sure you use a stable version.

See the installation instructions for WordPressCS; https://github.com/WordPress/WordPress-Coding-Standards

Regarding PHPCSUtils: that is a new dependency which WordPressCS 3.0.0 (currently in development) will use, It is basically a layer between PHP_CodeSniffer and an external standard to help with some of the more complex logic used in sniffs and with PHPCS cross-version compatibility.

Thanks It is working 👌🏻

Jan
22
2 days ago
Jan
21
3 days ago
started
started time in 2 days ago
started
started time in 2 days ago
started
started time in 2 days ago
started
started time in 2 days ago
started
started time in 3 days ago
started
started time in 3 days ago
Jan
20
4 days ago
started
started time in 3 days ago
started
started time in 3 days ago
started
started time in 4 days ago
started
started time in 4 days ago
pull request

Csardelacal pull request squizlabs/PHP_CodeSniffer

Csardelacal
Csardelacal

Added check for blank indented lines in functions

I'd like to preface this saying that I am very grateful for phpcs and that I understand that this PR represents an unpopular opinion. But while unpopular, it's consistent. I slightly modified the ScopeIndentSniff to allow a user to opt-into enforcing a consistent indentation with the rest of the code when a line is blank.

Usually PHPCS will rewrite a function with blank lines, trimming the whitespace. So the function:

function x($y)
{
/*4s*/$z = $y * 2;
/*4s*//*[LF]*/
/*4s*/return $s;
}

Becomes:

function x($y)
{
/*4s*/$z = $y * 2;
/*[LF]*/
/*4s*/return $s;
}

I find it incredibly frustrating when linters and IDEs trim the whitespace of blank lines. When I leave a line blank, and then attempt to write into it, the cursor will be at the wrong position and force me to jump back to the actual indentation level of the function.

I consider a blank line that is indented according to the surrounding scope to not be extraneous whitespace, since the indentation (at least my understanding of it) makes an indented blank line consistent with the rest of the lines within the function or method. Which is the reason why I personally like to include them.

This issue gets compounded when a collaborator submits code and their IDE just trimmed the whitespace that I purposefully left in there, causing the diffs to include a ton of whitespace changes that have nothing to do with the change they submitted.

I'd like to request this opt-in feature to be included. I know it represents a small user base. But, It's opt-in, represents a very small change to the codebase and does provide a ton of creature comforts for teams that wish to use it.

Thank you very much for your attention and I look forward to being able to set the indentWhitespaceInScope flag in the future.

Activity icon
fork

Csardelacal forked squizlabs/PHP_CodeSniffer

⚡ PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
Csardelacal BSD 3-Clause "New" or "Revised" License Updated
fork time in 4 days ago
Jan
19
5 days ago
started
started time in 4 days ago
started
started time in 4 days ago
Activity icon
fork

arunnatarajs forked squizlabs/HTML_CodeSniffer

⚡ HTML_CodeSniffer is a client-side JavaScript application that checks a HTML document or source code, and detects violations of a defined coding standard. Comes with standards that cover the three conformance levels of the W3C's Web Content Accessibility Guidelines (WCAG) 2.0 and the U.S. Section 508 legislation.
arunnatarajs Updated
fork time in 4 days ago
Previous