Skip to content
Snippets Groups Projects
Unverified Commit c43cb34e authored by Klaus Purer's avatar Klaus Purer Committed by GitHub
Browse files

fix(LineLength): Do not check phpcs:ignore lines for line length (#3477601)

parent ce445b9f
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,11 @@ class LineLengthSniff extends GenericLineLengthSniff
protected function checkLineLength($phpcsFile, $tokens, $stackPtr)
{
if (isset(Tokens::$commentTokens[$tokens[($stackPtr - 1)]['code']]) === true) {
// Allow any PHPCS ignore comments to exceed the 80 character limit.
if (isset(Tokens::$phpcsCommentTokens[$tokens[($stackPtr - 1)]['code']]) === true) {
return;
}
$docCommentTag = $phpcsFile->findFirstOnLine(T_DOC_COMMENT_TAG, ($stackPtr - 1));
if ($docCommentTag !== false) {
// Allow doc comment tags such as long @param tags to exceed the 80
......
......@@ -2,4 +2,13 @@
function foo() {
echo 'test';
}//end foo()
\ No newline at end of file
}//end foo()
class Test {
/**
* The search score.
*/
public string $search_score; // phpcs:ignore Drupal.NamingConventions.ValidVariableName.LowerCamelName
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment