Active
Project:
Drupal core
Version:
main
Component:
other
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
22 Sep 2015 at 14:20 UTC
Updated:
20 Oct 2025 at 06:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
attiks commentedEmpty patch
Comment #4
duaelfrAs agreed between the mentors at Drupalcon, according to issues to avoid for novices, I am untagging this issue as "Beginner". This issue contains changes across a very wide range of files and might create too many other patches to need to be rerolled at this particular time. This patch has an automated way to be rerolled later so better to implement it after Drupalcon.
Comment #5
attiks commentedClosing since it is not blacklisted in phpcs.xml
Comment #6
attiks commentedClosed the wrong one, this needs a manual patch probably
Comment #7
pfrenssenComment #9
vprocessor commentedComment #10
vprocessor commentedall is ok there after phpcbf work
output:
----------------------------------------------------
No fixable errors were found
Time: 4 mins, 10.39 secs; Memory: 125.25Mb
Comment #11
alexpott@vprocessor this is because phpcbf can't fix these errors. If you run phpcs you will see a lot of warnings about lines being too long.
Comment #12
vprocessor commentedComment #13
pfrenssenComment #14
pfrenssenComment #15
andypostLooks the sniffer does not work cos "phpcs" returns nothing
Comment #16
pfrenssenComment #17
andypost1197 Drupal.Files.LineLength.TooLongComment #18
vprocessor commentedComment #19
dawehnerGiven #17 this is needs work
Comment #20
mile23Patch in #10 no longer applies. Not marking as 'needs reroll' because whoever works on this should just re-do the work.
I'd wager that the rule in question here can't fix the errors it finds through phpcfb, which is why no errors were found in #10.
Updating instructions.
Comment #21
mile23Here's a patch which only covers
core/lib/Drupal/Component.Pretty tedious work, also tedious to review. Should we split it up by directory? By module?
Also: The sniff doesn't count multibyte chars properly, so you end up with an error in core/lib/Drupal/Component/Utility/Html.php comments.
Comment #22
alexpottWe need to fix the sniff then.
Comment #23
mile23Filed this issue: #2761027: False positive for Drupal.Files.LineLength for multibyte characters
Comment #25
mile23From #2761027: False positive for Drupal.Files.LineLength for multibyte characters it turns out we need to do this:
So here's a patch against 8.2.x since it's docs-only changes, for the Component namespace.
I experimentally removed the LineLength rule and left the UTF-8 encoding. phpcs didn't burp on anything, so it looks safe to add it.
Comment #26
dawehnerIs it on purpose that we just fix the component bits?
Comment #27
mile23Because there's no automated fix, and we're changing the line length of comments by hand. And then we have to review the changes. See #21.
Comment #28
Everett Zufelt commentedI tested the patch in #2572709-25: [meta] Fix 'Drupal.Files.LineLength' coding standard there are no warnings for core/lib/Drupal/Component .
Is the plan to have one large patch, or to break this in to sections?
Comment #29
Everett Zufelt commentedI find it interesting that some of the first warnings in core are permissible in the coding standards, but not caught by the sniff. Perhaps it is worth identifying these so that the sniff can be updated prior to attempting to correct all of the files?
E.g.
* - @link https://www.drupal.org/project/examples Examples project (sample modules) @endlinkThe sniff appears to account for @link exceeding 80 chars, but not when it is in a list.
Comment #30
mile23@Everett Zufelt Could you please file an issue about that in the coder project?
Comment #31
alexpott@Everett Zufelt the plan with these issue is to get the coder sniff fixed and then apply it in one go to core and the enforce the rule on all following patches to prevent regression.
Comment #32
Everett Zufelt commentedAdded #2791183: LineLengthSniff warns when @link is > 80 chars if in a list.
Comment #33
Everett Zufelt commentedIt looks like #2791183: LineLengthSniff warns when @link is > 80 chars if in a list. is fixed in Coder 8.x-2.x.
Comment #34
Everett Zufelt commentedAdded corrections for
/core/core.api.php
/core/includes
Based on Coder 8.x-2.x, the 8.x-2.9 release does not include the fix mentioned in comment #33.
Comment #35
Everett Zufelt commentedIn /core/lib/Drupal/Core/Cache/Cache.php line 99 @deprocated is used. followed by a Use comment.
There are no examples of @deprocated in the comment standards. Is there a better way for this to be presented (perhaps using @code) or should this be allowed to exceed 80 chars?
Comment #36
dawehnerunrelated change
Comment #37
Everett Zufelt commented@dawehner, I agree it is not directly related. It is however not permitted in the commenting standards, and is identified as an error by Coder 8.x-2.x.
Comment #38
mile23Thanks, but the scope of this issue is for Drupal.Files.LineLength only. There are other issues for other rules: #2571965: [meta] Fix PHP coding standards in core, stage 1 That way the process of fixing these things is more manageable and consistent.
Also, we're normalizing on coder 8.2.8 for now: #2744463: Add phpcs, coder 8.2.8 as --dev requirements for drupal/core
Comment #39
dawehner@Mile23
Thank you for making that clear!
I hope one day we establish a culture of not considering to even think about out of scope changes.
Comment #42
andypostIt needs new patch after #2923670: The one-line summary of ImageEffectInterface::getDerivativeExtension() is too long
Comment #43
ivan berezhnov commentedComment #46
izus commentedworking on this
Comment #47
izus commentedHi,
this one is an eyes killer, so i'll stop it for today
the final patch promesses to be huge
here i attach a patch for my progress on this but the work stills in progress
will upload WIP patches as i progress on this
Comment #48
izus commentedPatch #47 no longer applies
here is a reroll of it
Thanks
Comment #49
izus commentedprogressed on this but it stills WIP
Comment #50
izus commentedmore progress
Comment #51
izus commentedAnd here it is ready for review
Comment #52
izus commentedyay, it's green :)
Comment #53
alexpott@izus thank you for picking this up and working on it. Here is the start of a review. Unfortunately it is a really big job to get core to comply with our own standards :(
This displayed to a user and we have a rule that the first line must be on one line for a method.
The instead should be indented.
The one line method rule
Should be indented
One line rule.
The second line of a list should be indented.
Indentation
One line rule.
One line rule
More one line rule.
It looks like there is plenty to do because we don't have all the other rules implemented yet. I think before we tackle this one we should try to fix
Drupal.Commenting.DocComment.ShortSingleLinefirst. It should be a sub-issue of #2572635: Fix 'Drupal.Commenting.DocComment.LongFullStop' coding standard as doing that will help us not introduce more instances of that here.Comment #57
daffie commentedThe remarks of @alexpott from comment #53 still need to be addressed.
Comment #58
narendra.rajwar27Comment #59
narendra.rajwar27Re-created the patch using comment #51 patch. Also made changes as per comment #53.
There are some files which are either not available in d9 or they have already fix applied for line exceeding 80 chars issue.
Here i am mentioning those files:
So it will be great if someone can review and share feedback, if this needs more work.
Comment #60
narendra.rajwar27Comment #61
daffie commentedThe testbot returns 900 coding standard violations for the current patch. See: https://www.drupal.org/pift-ci-job/1710079.
Comment #62
narendra.rajwar27Comment #63
narendra.rajwar27Probably pick this again once get the ample time to fix this. Meanwhile Please feel free to fix as i am unassigning this.
Comment #64
sanjayk commentedComment #65
sanjayk commentedI have create a new issue for coding standard issues here https://www.drupal.org/project/drupal/issues/3156059.
Comment #66
pasqualle#3173782: Increase line length limit to 120
Comment #69
daffie commentedComment #70
ankithashettyWorking on the reroll, thanks!
Comment #71
ankithashettyRe-rolled the patch in #59, thank you!
Comment #72
daffie commentedFar too many style guide violations to review.
Comment #73
jonathan1055 commentedShouldn't this work be halted until #3173782: Increase line length limit to 120 is decided? If the length is increased, even to 100 chars, then a huge number of these current failings will no longer be a problem.
Comment #78
quietone commented@rifas-ali-pbi, credit for creating a fork has been removed per How is credit granted for Drupal core issues.
Yes, let's postpone.
Comment #80
quietone commentedI've been taking a closer look at this over the holiday period. I am un-postponing this because most new code is wrapped at 80 columns and while there are a lot of files to change, it is a small percentage. And even increasing the line length will not fix wrapping.
Comment #81
quietone commentedComment #82
quietone commentedComment #83
quietone commentedComment #84
nod_Should this meta add the phpcs rule, or we leave that to a child issue?
Comment #85
quietone commentedComment #86
quietone commentedComment #87
quietone commentedComment #88
quietone commentedComment #89
quietone commentedComment #90
quietone commentedComment #91
quietone commentedComment #92
quietone commented