-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All-capitalized NULL, FALSE, TRUE in comments? #5
Comments
@herbdool many thanks for sneaking in. Can you provide a case, where this rule makes wrong suggestions? (Note that the rule itself is forked from the Drupal ruleset.) And - are you interested in becoming a co-maintainer? 😏 |
Sure, I can co-maintain. I haven't used this much but I'm increasingly exposed to it with my PRs so may as well help a bit. I saw this issue: backdrop/backdrop-issues#6004 and the first PR backdrop/backdrop#4369 passed the linting with this |
Indicating data types in documentation says to use |
@herbdool Normally in Backdrop we use uppercase for these things, except in this context where our documentation standards specifically say to use the lowercase versions (as @kiamlaluno linked to). Maybe @quicksketch forgot about that... |
Maybe, though there are a lot of examples so I don't think it was an accident. It's equally plausible that this part of the coding standards was overlooked. I didn't intend to throw a wrench/spanner into getting the code updated, but I think it's worth getting some clarification on which way core committers and others lean on this. I was basing my response just on looking at the code. And I found examples like https://github.com/backdrop/backdrop/blob/d688729ab0b31a1f0d16d0af33c97807cfad61e4/core/includes/config.inc#L277 and https://github.com/backdrop/backdrop/blob/d688729ab0b31a1f0d16d0af33c97807cfad61e4/core/modules/layout/includes/block.class.inc#L36, which are from the more recent code. And I figured it made some sense since
or core/includes/menu.inc:
|
@herbdool Thanks for wanting to bring consistency to this! Nothing worse than having things done differently in different places. But that's why we have documentation/coding standards. And in this instance they're pretty clear:
(https://docs.backdropcms.org/doc-standards#types) I don't think finding counter examples of this in core is reason to think the standards are wrong. More like the code is wrong and needs to be fixed. Also, the examples you linked to are not very recent (not that that's really a factor anyway) - one's from 2016, the other's from 2013... I'd suggest bringing this up in the core issue queue if you want to confirm the standards are correct, or if you'd like to suggest they be updated. IMO, this repo is just about enforcing the already-documented standards. |
Of course, PHP 8.2 confuses matters even further by creating |
In fact, I've always used lowercase terms in comments. @kiamlaluno already linked our official docs. And that's also how this rule specifies. So, unless there's a change in our specs, the rule conforms to that. 😉 |
This is something that still needs to be resolved, I think, since it's some of the same people adding the official docs and then doing something different in practice. The official docs are not written in stone, so we can either edit the official docs or go back and change the code that was being added. As one of the core committers I wasn't involved in adding or editing the docs, so I'm not aware of how much discussion took place at the time they were added. |
Take a look at this issue: backdrop/backdrop-issues#1937 It was a systematic updating of core, which also involved adding My quick and dirty search in core (PHP files only):
|
Agreed @herbdool, but as I said above:
Because the people you're referring to likely aren't reading this issue. And as @indigoxela said:
Meaning until there's concensus in core that our coding standards are wrong and/or need updating, there's no point debating all this in this queue. |
I've created an issue there backdrop/backdrop-issues#6014 |
As per the other issue, we decided nothing needed to change. So closing this issue too. |
I believe it should be
@param array|NULL
, for example.Looks like it's incorrect here?:
phpcs/Backdrop/Sniffs/Commenting/FunctionCommentSniff.php
Line 34 in a588dc2
The text was updated successfully, but these errors were encountered: