Closed (duplicate)
Project:
Drupal core
Version:
9.2.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Oct 2019 at 10:44 UTC
Updated:
18 Dec 2020 at 00:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
robindh commentedPatch for version 8.9.x
Comment #3
robindh commentedComment #4
joachim commentedThanks for the patch! Looks good.
Comment #5
vodde83 commentedAgreed, looks good
Comment #6
alexpottThank you for your work on cleaning up Drupal core's code style!
In order to fix core coding standards in a maintainable way, all our coding standards issues should be done on a per-rule basis across all of core, rather than fixing standards in individual modules or files. We should also separate fixes where we need to write new documentation from fixes where we need to correct existing standards. This all should be done as part of #2571965: [meta] Fix PHP coding standards in core, stage 1. A good place to start is the child issues of #2572645: [Meta] Fix 'Drupal.Commenting.FunctionComment' coding standard.
For background information on why we usually will not commit coding standards fixes that aren't scoped in that way, see the core issue scope guidelines, especially the note about coding standards cleanups. That document also includes numerous suggestions for scoping issues including documentation coding standards cleanups.
Contributing to the overall plan above will help ensure that your fixes for core's coding standards remain in core the long term.
In this instance we need to add a new sniff to discover classes without a leading slash to the coder project.
Comment #7
joachim commentedThis is affecting Drupal Code Builder, which outputs broken code because of this.
I'll look into creating a sniff, but please could we fix this in the meantime? It's not just a coding standards issue.
Comment #8
jungleComment #10
narendra.rajwar27Comment #11
siddhant.bhosale commentedComment #12
siddhant.bhosale commentedThe patch works against the branch 9.1.x. Looks good to be merged. Thank you.
Comment #13
jungleComment #14
jungleAdding a related issue. A follow-up seems unnecessary
Comment #15
xjm*.api.phpare just documentation; does Drupal Code Builder somehow parse them to do the code generation?I personally would want to ensure this was fixed at least in all
*.api.phpeither way. A sniff has still not been created yet and other*.api.phpare also wrong, including in hook signatures and the like.If we could get clarity on what exactly the bug that's being caused is, that'd make it easier to make sure we're fixing that bug completely (here and/or elsewhere).
Comment #17
quietone commentedI happened across an issue that precedes this and does the same work, thus making this a duplicate.
Closing this as a duplicate of #2859992: [PP-1] Consistent use of leading \ for class names in *.api.php files, added the patch here to the patch there and added credit. I hope I did the credit correctly.
Adding this as child to the meta about the leading \ in class names.
Comment #18
quietone commented