This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reconfigured code sniffer to use vendor libs for wpcs and phpcs, upda…
…te PSR2 to make comment required
- Loading branch information
1 parent
f3b2d16
commit b86aa57
Showing
597 changed files
with
99 additions
and
77,251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
.DS_Store | ||
.idea | ||
.idea | ||
/vendor | ||
/composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env php | ||
<?php | ||
|
||
$root = dirname(__FILE__) . '/..'; | ||
|
||
require_once $root . '/vendor/squizlabs/php_codesniffer/autoload.php'; | ||
|
||
$argv = [ | ||
$_SERVER['argv'][0], | ||
'--config-set', | ||
'installed_paths', | ||
implode(',', array( | ||
$root . '/vendor/wp-coding-standards/wpcs/', | ||
$root . '/justcoded/', | ||
)), | ||
]; | ||
$_SERVER['argv'] = $argv; | ||
$_SERVER['argc'] = count($argv); | ||
|
||
$runner = new PHP_CodeSniffer\Runner(); | ||
$exitCode = $runner->runPHPCS(); | ||
exit($exitCode); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,28 +2,15 @@ | |
/** | ||
* Ensures doc blocks follow basic formatting. | ||
* | ||
* PHP version 5 | ||
* | ||
* @category PHP | ||
* @package PHP_CodeSniffer | ||
* @author Greg Sherwood <[email protected]> | ||
* @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) | ||
* @copyright 2006-2015 Squiz Pty Ltd (ABN 77 084 670 600) | ||
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence | ||
* @link http://pear.php.net/package/PHP_CodeSniffer | ||
*/ | ||
|
||
/** | ||
* Ensures doc blocks follow basic formatting. | ||
* | ||
* @category PHP | ||
* @package PHP_CodeSniffer | ||
* @author Greg Sherwood <[email protected]> | ||
* @copyright 2006-2012 Squiz Pty Ltd (ABN 77 084 670 600) | ||
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence | ||
* @version Release: @package_version@ | ||
* @link http://pear.php.net/package/PHP_CodeSniffer | ||
*/ | ||
class Generic_Sniffs_Commenting_DocCommentSniff implements PHP_CodeSniffer_Sniff | ||
use PHP_CodeSniffer\Sniffs\Sniff; | ||
use PHP_CodeSniffer\Files\File; | ||
|
||
class JustcodedPSR2_Sniffs_Commenting_DocCommentSniff extends \PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\DocCommentSniff | ||
{ | ||
|
||
/** | ||
|
@@ -50,15 +37,15 @@ public function register() | |
|
||
|
||
/** | ||
* Processes this test, when one of its tokens is encountered. | ||
* | ||
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned. | ||
* @param int $stackPtr The position of the current token | ||
* in the stack passed in $tokens. | ||
* | ||
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. | ||
* @param int $stackPtr The position of the current token | ||
* in the stack passed in $tokens. | ||
* | ||
* @return void | ||
*/ | ||
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) | ||
public function process(File $phpcsFile, $stackPtr) | ||
{ | ||
$tokens = $phpcsFile->getTokens(); | ||
$commentStart = $stackPtr; | ||
|
@@ -119,8 +106,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) | |
|
||
// Check for a comment description. | ||
if ($tokens[$short]['code'] !== T_DOC_COMMENT_STRING) { | ||
$error = 'Missing short description in doc comment'; | ||
$phpcsFile->addError($error, $stackPtr, 'MissingShort'); | ||
// @inheritdoc hotfix | ||
if (stripos($tokens[$short]['content'], '@inheritdoc') === false) { | ||
$error = 'Missing short description in doc comment'; | ||
$phpcsFile->addError($error, $stackPtr, 'MissingShort'); | ||
} | ||
return; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.