Closed (fixed)
Project:
Devel
Version:
8.x-3.x-dev
Component:
testing
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
5 May 2020 at 08:00 UTC
Updated:
2 Jun 2020 at 07:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jonathan1055 commentedHere's a patch which should check all of the files of these four types, but only these. Also it skips the full phpunit testing as that is unnecessary until the final check, and just wastes d.o. resources.
Comment #3
jonathan1055 commentedSo we get
CONTRIBUTING.md ✗ 5 more
devel_generate/README.md ✗ 1 more
README.md ✗ 1 more
webprofiler/README.md ✗ 9 more
Lines that end with a url are exempt from the 80 char limit, others can be fixed and the flow of the rendered markdown will not be affected. Or maybe we want to ignore the 80 char limit just for .md files?
Comment #4
moshe weitzman commentedHi. Sorry I should have checked with you before changing this. I kind of assumed that neither PHPCS nor Drupal coding standards had much applicability to non-PHP files.
I think that 80 char limit is super outdated. Linus said so in 2009! https://lkml.org/lkml/2009/12/17/229
These violations are just frustrate devs. And they consume more CI minutes as devs retest to try to get to green. Since devel's phpcs.xml.dist is currently the model in the docs, I propose we either omit these file types, or exempt text files from line length rule. Either one is fine with me
Comment #5
jonathan1055 commentedYes I agree.
I will exempt text files from the 80 limit. Presume this is only for the 3.x branch? I have not been making any changes to 2.x apart from really obvious and necessary fixes. Actually, just realised we don't have a phpcs.xml.dist in 2.x as I only introduced that in Nov last year on 3.x So it's just 3.x then.
Comment #6
jonathan1055 commentedPatch to fix the few things in .yml files
Comment #7
jonathan1055 commentedI noticed a few days ago that there was a drop in coding standards messages, but due to other files changing and moving I did not get to investigate it properly. I have now worked it through, and realised that a change from
<exclude-pattern>*.patch</exclude-pattern>to<exclude-pattern>.patch</exclude-pattern>had the effect of excluding all files with 'patch' anywhere in the name. This meant thatwebprofiler/src/EventDispatcher/EventDispatcherTraceableInterface.php(5 faults) andwebprofiler/src/EventDispatcher/TraceableEventDispatcher.php(30 faults) had got dropped from the report. Hence fixing that here by escaping the . with \.Comment #8
jonathan1055 commentedWe actually get the 36 extra messages for the two dispatcher files. TraceableEventDispatcher.php has 31 not 30 and the extra message is
Line 68 Unused variable $key.. This is created by sniffDrupalPractice.CodeAnalysis.VariableAnalysis.UnusedVariableand I have seen this variation before, e.g patch #2 above, this sniff is not reported on, but in patch #7 it was.Here's the patch to be committed, just to make sure the tests actually run OK.
Comment #10
jonathan1055 commentedI think there is no more to do here.
Issue also migrated to https://gitlab.com/drupalspoons/devel/-/issues/257 so I will close that too.