Active
Project:
Drupal core
Version:
main
Component:
other
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Mar 2020 at 08:07 UTC
Updated:
28 Nov 2025 at 11:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
foxtrotcharlie commentedComment #3
foxtrotcharlie commented@jungle - Codesniffer does detect a number of errors with
../vendor/bin/phpcs -pbut after I run the last command../vendor/bin/phpcbfI am told "No fixable errors were found". Any idea what I need to do to get it to do the automatic fixing? Or how I can figure out why the fixer is not fixing the errors that codesniffer detects?Comment #4
jungleHi, @foxtrotcharlie, thank you for working on this. Unfortunately, This one can not be fixed by
phpcbfautomatically.You can remove the following line from
core/phpcs.xml.distand runcomposer run phpcs -- -pto get the report.Meanwhile, I am submitting a patch by removing the above line to let CI tell what files need to be fixed.
Comment #5
jungleUpdate IS
Comment #6
jungleCorrect IS and adjust the format of IS
Comment #8
foxtrotcharlie commentedI'm just not going to have time to get to this, particularly because there are so many manual fixes required (1338) and my work workload has just increased dramatically. Will let it go for someone else to take on, sorry!
Comment #9
longwaveI don't think 1338 fixes in a single issue will be reviewable, especially as each of these needs a line of documentation to be written and agreed on. Should we break this down into sub-issues? How would we do that?
Comment #10
jungle#8, no worries, thanks!
#9 yes, totally agree!
I think the above kind of violations could be auto-fixed, as the short description could be
Class THE_CALSS_NAME.. I made a quick and small patch to coder to identify this pattern -- class missing short description, see the patch attached. With it,464fixable violations found, that's amazing.Meanwhile, I found that
734files are*Test.phpfiles and1012.phpfilesx1) method missing short description, 2) property missing short description, 3) function missing description (no sure if there are any) we can file 4 or 6 sub issues.Comment #11
jungleThe first child issue #3136779: Fix DocComment.ClassMissingShort in non tests is ready for review now. Down to 510 violations left from 1066 in the branch 9.1.x.
Comment #13
quietone commentedComment #19
scottatdrake commentedI started looking at this issue at #drupalconPortland2024. My understanding of the blocker here is that adding comments for 1,300+ classes in the format "Class [class name]" is not valuable, and there are too many to write manually. In fact, I think there may be a PHPStan rule prohibiting repeating the class name in the comment, though I'd need to verify that claim.
A couple of years have passed since this ticket was last updated. Now, we have LLM's like ChatGPT which can be pretty good at summarizing code. My idea is to write a script of some sort that passes the work of writing a meaningful description to one of them.
Reviewing such a large MR will still be a challenge but we may be able to automate the writing portion.
I'll wait for feedback before pursing this approach further.
Comment #20
quietone commentedComment #21
quietone commentedThere are too many changes here and they will require some thought to decide on a correct summary line, so making this a meta.
Comment #22
quietone commentedComment #23
quietone commentedComment #24
quietone commented