Hello all, it’s time for the fortnightly coding standards meeting.

This meeting:
➤ Is for anyone interested in the Drupal coding standards.
➤ Is held on the #coding standards channel in Drupal Slack (see www.drupal.org/slack for information).
➤ Usually happens fortnightly. Alternating between Tuesday 2100 UTC and Wednesday 0900 UTC.
➤ The meeting open for 24 hours to allow for all time zones.
➤ Discussion is done in threads, which you can follow to be notified of new replies even if you don’t comment in the thread. You may also join the meeting later and participate asynchronously.
➤ Has a public agenda anyone by adding a comment to the meeting issue.
➤ A transcript will be made using drupal-meeting-parser and posted to the agenda issue. For anonymous comments, start with a :bust_in_silhouette: emoji. To take a comment or thread off the record, start with a :no_entry_sign: emoji.
➤ The transcript will include comments made during the 24 hours of the meeting. However, comments made after the 24 hours may not be in transcript.

Current ping list: @catch, @larowlan, @longwave, @quietone
@dww, @borisson_ @longwave @Björn Brala, @Aaron McHale, @Alex Skrypnyk, @Urvashi, @Kingdutch

Comments

quietone created an issue. See original summary.

larowlan credited andypost.

larowlan credited catch.

larowlan credited dww.

larowlan credited mstrelan.

larowlan’s picture

Status: Active » Needs review

removed

larowlan’s picture

Issue summary: View changes

removed

larowlan’s picture

Issue summary: View changes

0️⃣ Who is here today? Comment in the thread to introduce yourself. We’ll keep the meeting open for 24 hours to allow for all time zones.

quietone Hi
larowlan Current ping list: @catch,  @longwave,@dww, @borisson_ , @Björn Brala (bbrala)  @Aaron McHale, @Alex Skrypnyk, @urvashi_vora
Alex Skrypnyk Hi all! Sorry for missing couple of last meetings. I'm here
catch not really here but also hello 🙂
longwave :wave:
kimb0 :wave::skin-tone-2:
dww Derek in the Hawaiian Kingdom.
Aaron McHale Late to the party, but here

1️⃣ What topics do you want to discuss? Post in this thread and we’ll open threads for them as appropriate.

smustgrave Not sure if this is a coding standard and unfortunately have to step away for an hour.  But there’s been talk of needing or not needing a change record for new arguments being passed.  If the issue link is enough
larowlan Do you have an example? Meeting is open 24 hrs
quietone Improving git commit messages
smustgrave https://drupal.slack.com/archives/C1BMUQ9U6/p1707903129314539 was the conversation this came from
larowlan Ah that is outside the scope of coding standards - its one for framework managers/release managers
larowlan The policy is we do a best effort to provide a BC layer and add a change record (because the deprecation message needs a @see link)
smustgrave Gotcha wasn’t 100% if this was the right place but thought I’d ask!
larowlan No worries, thanks for flagging
quietone @smustgrave I am aware of that, and it is on my list.
catch It's in scope for coding standards... I'll start a thread.
kimb0 Does "Naming interfaces with an '-able' suffix allowed even if it is not a dictionary word"  (e.g. Stringable) fit into coding standards? Came up recently.
larowlan start a new thread for ^

2️⃣ Action items

2️⃣.:1️⃣ Approve minutes for previous meeting(s)

larowlan #3419359: Coding Standards Meeting Wednesday, 14 February 2024 09:00, UTC
larowlan Marked fixed

2️⃣ .2️⃣ TBD

3️⃣ Fixed since last meeting

larowlan N/A

4️⃣ RTBC issues

4️⃣.1️⃣ #3295249: Allow multi-line function declarations

larowlan Step 8 - docs updates
quietone Anyone want to volunteer to do the updates?
larowlan I will add to my list, but not going to make any promises about timelines 🙂

4️⃣ .2️⃣ #3074131: Use null coalescing operator ?? instead of a ternary operator with an isset() condition

larowlan I think this is up to step 7 for core committers

4️⃣.3️⃣ #3324368: Update CSS coding standards to include PostCSS and Drupal 10

larowlan Still at step 8, needs someone to make docs edits. Will ask in frontend
larowlan https://drupal.slack.com/archives/C0D5GJZ8B/p1709068665277659

5️⃣ New issues

5️⃣ .1️⃣ #3422530: Require short ternary (Elvis operator) syntax

quietone This needs someone to add the current documentation and the proposed documentation.
larowlan cc @mstrelan
mstrelan Yeah I'm keen for someone to help with that
quietone This would be a change to Operators
mstrelan Something like this:The "short ternary" operator ?: must be used where the first operand of a ternary expression matches the condition. For example $this->entityKeys['bundle'] = $bundle ? $bundle : $this->entityTypeId; should be written as $this->entityKeys['bundle'] = $bundle ?: $this->entityTypeId; since $bundle matches both the condition and the first operand.
mstrelan Can probably simplify those to use simple vars, like $result = $condition ? $condition : 'default'; as per https://stitcher.io/blog/shorthand-comparisons-in-php (edited)
mstrelan Added proposed changes to issue summary
Alex Skrypnyk @mstrelanYou've set status to Needs work - could you please clarify what it needs work on. The proposed changes in summery looks good. (edited)
mstrelan steps 2 and 3 in the remaining tasks:Add supportersCreate a Change Record
mstrelan can we list those who have commented as the supporters? i.e. acbramley, drunken monkey and alex.skrypnyk? (edited)
mstrelan would love if someone else can create the draft CR
larowlan the CR is just the before and after you posted above
larowlan @Alex Skrypnyk ^ @acbramley ^ is michael ok to put you as a suporter
acbramley that was my intention with the comment 🙂
mstrelan you had given support before there was a proposal, it was a blank cheque :wink:
acbramley Oh... I think I could figure it out :joy:

6️⃣ https://drupal.slack.com/archives/C02LJCF78E8/p1707901919167589 per @dww on last minutes

quietone catch pointed out that the commit message isn't really a coding standard but does fit within the TWG.
larowlan Which is outside our scope?
quietone Technically, I think so. But the members of the TWG are also on this committee.
larowlan :open_mouth: I didn't realise I was on the TWG
quietone While not strictly a 'coding' standard, this is a standard for Drupal so I support discussing it here and making progress.
quietone In this comment dww asks for an issue summary update or creation of a meta. That is one place to start.
quietone Another might be to decide if we want to use conventional commits.
quietone I've been considering doing the work dww suggested. I guess it is time to assign myself to that.
dww Thanks for keeping this flame alive, y’all! I’m willing to do the issue meta work if y’all want me to take a first pass, then it could be edited / refined. I’m pretty slammed on many fronts and might not get to it for a little while. But I know quietone already has a lot on the plate, and I wasn’t bringing this topic up so they would have to do more work. :sweat_smile:
dww Mostly I’m excited that y’all seem to agree with me that this is an important standard for Drupal development. If we’re dealing with CSS, JS, PHP, etc, I believe the commit history is central to “the code”.
dww I want to find a way to make this happen, and it seems like this is a great place since we already have so much process and practice in place.
quietone @dww, thanks for the offer. I am having a go at it, so let's see how far I get.
quietone I found this related issue . Does anyone know if it is still relevant? #1717676: Core commit credit and log messages are inconsistent between patches and merges
quietone I set this one RTBC, #2811033: Discuss if git commit messages should be multiple lines
quietone This one can likely be closed for lack of support, #2419385: Add initial past-tense verb to generated git commit message
Aaron McHale If you look at the commit history in GitLab, it's pretty much impossible to know which commit is which because usually the list of contributors flows off the screen and causes the actual description to not be visible. So in my opinion, the multi-line format proposed in the summary of #2323715: [policy, no patch] Determine format for commit credit for individuals/organizations/customers is much better!

7️⃣ Do deprecations always have to link to a change record for core, or can self-documenting @internal deprecations link to the issue instead?

catch Ongoing discussion here:https://drupal.slack.com/archives/C1BMUQ9U6/p1707903129314539IMO the current coding standard is ambiguous because it's not clear if the CR for core is required or preferred, and contrib doesn't have them.
andypost The same question raised for constructor arguments, cos formally we need a link[#3416354]#comment-15464266
kimb0 Contrib doesn't have CRs?
andypost There's for sure but not so popular as core
catch oh whoops. This is what happens when you maintain zero contrib modules. Didn't see the project field on https://www.drupal.org/node/add/changenotice
smustgrave Think this is kind of an important one for consistency.
kimb0 I'm doing a talk at DrupalSouth for contrib module maintainers so tried it out recently to make sure you can. :sweat_smile:  I think it is pretty handy for contrib maintainers to document upgrade changes, deprecations, etc.

8️⃣  Naming interfaces with an '-able' suffix (edited) 

kimb0 Does "Naming interfaces with an '-able' suffix allowed even if it is not a dictionary word" (e.g. Stringable) fit into coding standards? Came up recently.
kimb0 See #2985362: Create an interface to share the definition of the overridable methods on DefaultsSectionStorageInterface and LayoutEntityDisplayInterface
kimb0 Or more generally, method names as verbs and classes/interfaces as nouncs. e.g. class Finalizer has a finalize() method. See #2012976: Deprecate user_logout() and user_login_finalize() and replace with a service
kimb0 I'm in favour of not having to use proper english words for class names and interfaces
Alex Skrypnyk From ChatGPTIn PHP, the use of -able suffix for interfaces is more of a conventional pattern rather than a strict rule enforced by PHP itself. This convention is often applied to interfaces to indicate capability or intended action, similar to how -able is used in English to create adjectives meaning "capable of" or "suitable for." However, this convention is not documented in the PHP official manual or Symfony coding standards as strictly as the Interface suffix is.For instance, in object-oriented programming, interfaces like Iterable, Cacheable, or Renderable are named to describe the behavior or capability they represent, which aligns with the use of -able suffix in English​​. However, the official PHP documentation and Symfony standards do not specifically mention this -able naming convention. They focus more on the general principles of interface usage and naming conventions without explicitly addressing the -able suffix​​​​.For more detailed examples and PHP's approach to interfaces, you can refer to the PHP Manual's section on object interfaces​​. Also, for broader naming standards and conventions, the Symfony Coding Standards provide a comprehensive overview​​. Although not strictly related to -able, these resources give insights into how interfaces are used and named within PHP projects.
Alex Skrypnyk so, it looks like that Interface suffix is an industry standard and -able is a preference per project.
larowlan sorry but I don't consider output from an LLM as a reference point
larowlan I think prior art in PHP core such as Iterable, Countable is a good point
Alex Skrypnyk the Slack parser removed the references
Alex Skrypnyk https://www.php.net/manual/en/language.oop5.interfaces.phphttps://symfon...
larowlan Thanks
kimb0 To allow a function or method to accept and operate on a parameter that conforms to an interface, while not caring what else the object may do or how it is implemented. These interfaces are often named like Iterable, Cacheable, Renderable, or so on to describe the significance of the behavior.
kimb0 ^ from the first link
dww NodeInterface?  Nodeable ? :laughing:
Alex Skrypnyk NodableInterface  (it was a joke of course) (edited)
kimb0 I think it's a more useful convention when an interface provides a specific behaviour.
dww Sure.  I'm not saying we should never do this.  But I don't think we should always do it...
kimb0 oh no
kimb0 I'm arguing we should be 'allowed' to do it. ie. don't knock back class/interface names if they follow this convention
mstrelan I think it's ok to have Drupalisms, Symfonyisms, PHPisms and general Codeisms in code related stuff. Sometimes also user facing stuff, like Formatters (which is not a word, btw)
Aaron McHale NodableInterfacable kind of fun to say :smile:
smustgrave’s picture

Status: Needs review » Fixed

Went into the slack channel and all threads were captured and all participates added.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.