Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
coder
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
coder
Commits
c43cb34e
Unverified
Commit
c43cb34e
authored
3 months ago
by
Klaus Purer
Committed by
GitHub
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
coder_sniffer/Drupal/Sniffs/Files/LineLengthSniff.php
+5
-0
5 additions, 0 deletions
coder_sniffer/Drupal/Sniffs/Files/LineLengthSniff.php
tests/Drupal/Files/LineLengthUnitTest.inc
+10
-1
10 additions, 1 deletion
tests/Drupal/Files/LineLengthUnitTest.inc
with
15 additions
and
1 deletion
coder_sniffer/Drupal/Sniffs/Files/LineLengthSniff.php
+
5
−
0
View file @
c43cb34e
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
tests/Drupal/Files/LineLengthUnitTest.inc
+
10
−
1
View file @
c43cb34e
...
...
@@ -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
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment