Closed (fixed)
Project:
Drupal core
Version:
8.7.x-dev
Component:
other
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Nov 2017 at 19:58 UTC
Updated:
28 Sep 2018 at 12:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
zaporylieComment #4
borisson_There is no phpcs-rule that is added for this, so I'm not sure if we can just rtbc this. I didn't find anything other that uses
array(),Array,[], ornumericas@varoptions.Comment #5
borisson_I thought again about #4 and I think that we should commit this, we can then also fix #2926120: @var tag must not end with a full stop.
And in #2909370: Fix 'Drupal.Commenting.VariableComment.IncorrectVarType' coding standard the phpcs rule can get fixed.
Comment #6
borisson_per #5.
Comment #7
zaporylieThanks @borisson_
I hope to find time soon to work on mentioned issues.
Comment #8
alexpott@borisson_ but we should add a phpcs rule for this. So we don't regress otherwise we will.
Thank 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.
Comment #9
borisson_@alexpott: the phpcs rule will get added in #2909370: Fix 'Drupal.Commenting.VariableComment.IncorrectVarType' coding standard, but that issue was split up by @xjm (https://www.drupal.org/project/drupal/issues/2909370#comment-12350324)
Comment #10
idebr commented#8/#9 Since this is a child issue out of 3 issues split from #2909370: Fix 'Drupal.Commenting.VariableComment.IncorrectVarType' coding standard I agree it will be difficult to add a sniff covering only this issue.
However, codesniffer found another entry:
Comment #12
zaporylieComment #13
juliusz_cheddar commentedI will work on this issue now.
Comment #14
BartoszUrbaniak commentedI will work on this issue now.
Comment #15
zaporylieWe are working on it together with @Adameue and @BartoszUrbaniak during mentored contribution sprint in Darmstad.
Comment #16
juliusz_cheddar commentedNeeds reroll.
Received this error when trying to apply the patch.
error: core/modules/system/src/Tests/Common/SimpleTestErrorCollectorTest.php: No such file or directory
Comment #17
BartoszUrbaniak commentedI have rerolled patch to this issue. Comment #10 is not been addressed.
Comment #18
juliusz_cheddar commentedCreated patch addressed to #10.
Comment #19
juliusz_cheddar commentedComment #20
BartoszUrbaniak commentedI have applied 2926122-18.patch.
After this I run this command:
vendor/bin/phpcs --standard=core/phpcs.xml --runtime-set installed_paths vendor/drupal/coder/coder_sniffer -- '-ps'
Results which I received from CodeSniffer scan shows that previous errors has been repaired.
Comment #21
alexpottCommitted and pushed dd7fd60f19 to 8.7.x and ace96040c4 to 8.6.x. Thanks!
As these are docs fixes and no new coding standard is enforced backported to 8.6.x.
Comment #24
zaporylieThank you alexpott!