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

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.

larowlan :wave:
kimb0 :wave::skin-tone-2:
Björn Brala (bbrala) Hi there :slightly_smiling_face:
longwave :wave:

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

2️⃣ Action items

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

Kingdutch Thanks for updating the issue summary quietone :smile:Meeting notes here: [#3438058]The only thing before approving is fixing the issue credits for participants (that's not something I can do)
longwave applied issue credit, minutes look good to me so I marked Fixed

2️⃣.2️⃣ TBD

quietone Announcement for [\#3074131] (edited)

3️⃣ Fixed since last meeting

quietone Minutes #3438057: Coding Standards Meeting Wednesday 2024-03-26 2100 UTC
quietone Project page updated according to item #6 of last meeting
quietone And 2 won't fix, 3440284 and 3099562
quietone And 1 outdated 2689243

4️⃣ RTBC issues

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

quietone All the steps are shown as completed.
quietone So, this needs a review to make sure everything is done correctly.
quietone I see that Coder has a new release with a rule for this.  We should have someone try that an then update or create new core issues.
Jonathan1055 The new coder rule does have full 'auto fixing' when you run phpcbf so for the contrib projects that will suddently be seeing new coding standards warnings, it is easy to solve. Is there a way that this can also be shared?
Björn Brala (bbrala) I'd say we should add 'finished' stuff to the posts we do also regarding final discussion if there are fixed issues.
Björn Brala (bbrala) nvm my suggestion.
Björn Brala (bbrala) im currently checking how core does with those new rules :x
Björn Brala (bbrala) but as its 'MAY' it shoudl technically be fine.
longwave fwiw we upgraded to the new Coder on a work project yesterday and phpcbf correctly fixed all of our badly formatted constructors (edited)
Björn Brala (bbrala) oh nice
Björn Brala (bbrala) Perhaps you could comment in the issue?
Björn Brala (bbrala) #3295249: Allow multi-line function declarations
longwave will do!
Björn Brala (bbrala) Then i'll close it up with some loving words heh
Björn Brala (bbrala) ah, i assumed core lol :stuck_out_tongue_winking_eye: sorry
longwave ah yeah not core :smile:
Björn Brala (bbrala) i'll check against core just to be sure if possible
Björn Brala (bbrala) Thanks though, real world validation is very helpful
longwave depending on where this is implemented in coder it might need adding to core's phpcs.xml.dist
Björn Brala (bbrala) yeah probably
Björn Brala (bbrala) i'll just do a quick rundown, see how it goes.
Björn Brala (bbrala) Yeah it seems we need a slight update to the phpcs.xml.dist
longwave if you open an issue in core queue i'm happy to help shepherd it along
Björn Brala (bbrala) thanks, will do
quietone We should also check if this effect any of the existing issues at #2571965: [meta] Fix PHP coding standards in core, stage 1
quietone I don't think is does but best to be sure.
Björn Brala (bbrala) the new coder release you mean? (edited)
quietone I was referring to any change or new sniff specific for this issue.
Björn Brala (bbrala) kk, will do :slightly_smiling_face:
Björn Brala (bbrala) Well core doesnt comply with the standard it seems :stuck_out_tongue:
Björn Brala (bbrala)
public static function cleanCssIdentifier($identifier, array $filter = [
    ' ' => '-',
    '_' => '-',
    '/' => '-',
    '[' => '-',
    ']' => '',
  ]) {.
Björn Brala (bbrala) and quite a few more
Björn Brala (bbrala)
This is knida annoying...> phpcs --standard=core/phpcs.xml.dist --parallel="$( (nproc || sysctl -n hw.logicalcpu || echo 4) 2>/dev/null)" -- '--report-full' '--report-summary' '--report-\Micheh\PhpCodeSniffer\Report\Gitlab=phpcs-quality-report.json'
FILE: /builds/issue/drupal-3443117/core/lib/Drupal/Core/DrupalKernel.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 556 | ERROR | Function return type is void, but function contains return
     |       | statement
--------------------------------------------------------------------------------
Time: 10.7 secs; Memory: 8MB
PHP CODE SNIFFER REPORT SUMMARY
--------------------------------------------------------------------------------
FILE                                                            ERRORS  WARNINGS
--------------------------------------------------------------------------------
.../issue/drupal-3443117/core/lib/Drupal/Core/DrupalKernel.php  1       0
--------------------------------------------------------------------------------
A TOTAL OF 1 ERROR AND 0 WARNINGS WERE FOUND IN 1 FILE
--------------------------------------------------------------------------------
Björn Brala (bbrala) but it does have:phpcs:ignore Drupal.Commenting.FunctionComment.VoidReturn
Björn Brala (bbrala) All the other fucntionas that had that added in commit a6c9dbbe28068daefb12bec06df45ab0f1850efe have no issue, only this one.
Björn Brala (bbrala) Drupal.Commenting.FunctionComment.VoidReturnversus Drupal.Commenting.FunctionComment.InvalidReturnVoid
Björn Brala (bbrala) mightve changes, ill look at that later, need to do some other stuff now.
Jonathan1055 Is that in the header? I think that phpcs:ignore is just for the next line of a file. For the rule to be ignored in the whole file, use phpcs:disable
Björn Brala (bbrala) It's in the docblock
Björn Brala (bbrala) But seems to target wrong sniff for some reason, or the sniff was renamed
Björn Brala (bbrala) Haven't investigated yet
Jonathan1055 If it is in the docblock then I think you need phpcs:disable not phpcs:ignore
longwave the first ignore worked, it's just that there are two rules to ignore now i think
longwave or we fix it so a void return function does not try to return anything :slightly_smiling_face:
longwave (this method is gone from Drupal 11 as it is unused)
Björn Brala (bbrala) perhaps the difference with the others is the fact other return void or empty return and this one scautlly returns something very diffrerent?
Björn Brala (bbrala) what would you prefer longwave?
Björn Brala (bbrala) fix ignore would be easiers probably (edited)
longwave yeah if we can just add a second ignore to the docblock and that solves it that seems easiest
Björn Brala (bbrala) will do
longwave the fix is also trivial but it's a bit scope-creep in a coder upgrade issue
Björn Brala (bbrala) yeah it is :stuck_out_tongue_winking_eye:
Björn Brala (bbrala) pushing
Björn Brala (bbrala) php cs is green, and did fail on a lot of trailing commas and such, so seems like core is happy :wink: https://git.drupalcode.org/issue/drupal-3443117/-/jobs/1415287
Björn Brala (bbrala) This issue is ready for review.#3443117: Fix Drupal.Functions.MultiLineFunctionDeclaration coding standard
Björn Brala (bbrala) Think head is broken. gonna see what happens, im not the only one with that test failure.https://drupal.slack.com/archives/C1BMUQ9U6/p1713963828107659

4️⃣.2️⃣ #3339746: Coding style for PHP Enumerations

quietone From \#48 there is another item here about what form of upper and lower camel case to use.
quietone What ever we decide I am pretty sure there will be CS wiki pages to change.
quietone I do like the versions of 'camel' case suggested by dww
longwave yeah i agree that we should be explicit with UpperCamelCase and lowerCamelCase and not just say CamelCase anywhere
longwave i also agree we could fix this any time, it doesn't have to be as part of the Enums issue
longwave is this ready for an announcement? i think we should also give recipes a heads-up as they are planning to merge to core soon and they are using all-uppercase
quietone I support an announcement.
longwave opened #3443118: Enum cases may need to change to UpperCamelCase

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

quietone This one also needs an announcement
Björn Brala (bbrala) #3443092: [2024-05-15] Prepare blogpost for annoucement/updates
Björn Brala (bbrala) It was already announced for final discussion, think this is all done? Or am i confusing the process here.
Björn Brala (bbrala) Ok, i wanted to update the docs page, but cant. No permission. Asked here https://drupal.slack.com/archives/C5ABFBZ5Z/p1713946359911279 hopefully it'll get fixed (edited)
quietone Documentation updates are step 8 but step 7 hasn't happened. I don't think this went to a core committer meeting.
Björn Brala (bbrala) #3074131: Use null coalescing operator ?? instead of a ternary operator with an isset() condition#comment-15522049
quietone No, it did go and there was no objection. Let me update the issue.
Björn Brala (bbrala) Yeah it did and I tagged as such
Björn Brala (bbrala) :sweat_smile:
Björn Brala (bbrala) Forgot is then sorry
Björn Brala (bbrala) I could also update @quietone

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

quietone I am still working to make time to support this in some way.
longwave given that core already uses Prettier for formatting both CSS and JS, and it is opinionated and not configurable about almost everything (by design) I am hoping we can just simplify this down to "we follow Prettier's standards" (edited)
quietone I didn't know that.  Good to know.
longwave Prettier has PHP formatting in development, it may even be worth seeing how much different that is from our current standards, and joining forces there

5️⃣ New Issues

5️⃣.1️⃣ Should exit(); and die(); be called with or without parentheses?

quietone Do we want to pursue this?
quietone It is true it is inconsistent in core but there are less than 40 usages.
larowlan Our goal is to remove as many of them as possible, so I don't think we should have  a standard for it
quietone Is there an issue for the removals?
larowlan #1497162: Eliminate the use of exit in core
quietone Then this is a won't fix.
larowlan agree
Björn Brala (bbrala) Did the administration on that issue.

6️⃣ TBD (if needed)

7️⃣ Wrap up.  Keep chatting in the threads and feel free to add new ones. Meeting open for 24 hours

8️⃣  Creating next blog post - #3443092: [2024-05-15] Prepare blogpost for annoucement/updates

Björn Brala (bbrala) Opened an issue to collaborate on the blogpost.Personally i think we should also take the oppertunity of that blogpost to communicate fixed issues perhaps?
Björn Brala (bbrala) Hmm, although, change records do exist.  :x

Comments

quietone created an issue. See original summary.

quietone’s picture

Agree on form of UpperCamelCase and lowercamelcase and then update docs. From, https://www.drupal.org/project/coding_standards/issues/3339746#comment-1...

quietone credited larowlan.

quietone credited longwave.

quietone’s picture

Issue summary: View changes

quietone credited bbrala.

quietone’s picture

quietone’s picture

Status: Active » Needs review
urvashi_vora’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed the conversation from slack. Looks good to me.

urvashi_vora’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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