Closed (fixed)
Project:
Module Filter
Version:
4.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
16 Jan 2023 at 13:55 UTC
Updated:
31 Jan 2023 at 10:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #4
smustgrave commentedAdded a .prettierrc.json file and only errors I'm getting are from drupalci.yml. prettierignore doesn't work though.
Comment #5
jonathan1055 commentedOK I'll check what you have done and compare, as I had started this and had local changes ready.
Comment #6
jonathan1055 commentedI'm not sure what you meant by "prettierignore doesn't work" but I have added my file. If none exists then the testbot creates one containing "*.yml". But we can probably fix the faults, so do not need to ignore all .yml
There is a bug in testbot script which means that only the changed js files are sent to eslint. Changed .yml files are ignored, but then you get a surprise when the branch test is run and they are included. I have reported it on #3333051: Modified .yml files are not passed to eslint and fixed the bug.
Comment #7
jonathan1055 commentedThat's better. The test result is now running eslint on all files due to the prescence of
.eslintrc.jsonin the MR changed files. We get 486 faults, down by 280.Comment #8
smustgrave commentedI run npx eslint --ext yml web/modules/contrib/module_filter/ from my project root and get
Comment #9
jonathan1055 commentedThe steps need to appear in drupalci.yml, otherwise the test bot does not run them. We can resolve the empty mapping problem by specifying a parameter, say 'halt-on-fail' true/false, rather than let it use the default (even if that was the same as what we want). This also makes the file more explicitly clear.
Comment #10
jonathan1055 commentedThat's good. I added
halt-on-fail: truetemporarily to check that it works. That option does not work propery for phpcs.Only 1 coding fault in drupalci.yml that I missed. Fixing that and setting eslint halt-on-fail to false. Can be set back to true when we have fixed the javascript problems on #3331002: [META] Javascript and YML coding standards
Comment #11
jonathan1055 commentedI just made a grammar fix using the online file editor inside the MR. Not done that before. I have finished here ... ready for your final review and commit.
Comment #13
smustgrave commentedChanges look good!
Comment #14
jonathan1055 commentedThanks. The MR test ran fine, but I've just checked the newly run branch test and has ended with grey "Build sucessful", not a green "Success". However, phpunit tests have still been run. I will investigate what is going on.
Comment #15
jonathan1055 commentedIn the previous branch test log we have
The latest one has
The phpcs output is identical and the log is identical, apart from that single extra line "phpcs Returned 1". I guess this is caused by the addition of
halt-on-fail: true. Even though the phpcs did not fail, it sends return code 1 which is interpreted as a failure.Comment #17
jonathan1055 commentedThat's it! Adding 'sniff-all-files: true' to replicate the branch test showed that there was still one phpcs coding standards fault. I had already spotted this and added a patch on #3106511-26: Drupal PHP coding standards
If you commit that patch then the branch test should run and pass green, and we can leave 'halt-on-fail: true' for phpcs. The new MR on this issue does not need to be committed. I will close it.