- Issue created by @mparker17
- Status changed to Needs work
9 months ago 9:25pm 22 February 2024 - 🇨🇦Canada mparker17 UTC-4
Getting some linter suggestions for eslint and phpstan; will try to resolve these before merging.
- Status changed to Needs review
9 months ago 7:01pm 24 February 2024 - 🇨🇦Canada mparker17 UTC-4
Yay, all tests and lints are green!
Some notes on what I did:
- It might be easiest to review the 11 commits in the merge request one at a time, in chronological order.
- As a general best practice, I've found that, when you're first introducing linting to a project, establishing a "baseline" of ignored lints is the best course of action... if you disable that type of linting, then you'll have more work to do (i.e.: on new code) when you re-enable it; and if you just leave it, then contributors might just assume it's always been broken and not try to make their new code satisfy the linter.
- I started by copying the suggested
.gitlab-ci.yml
from the GitLab Templates project → , according to the instructions → . - I applied the automated linter suggestions for PHPCS, which fixed all of them.
- I ignored all the "misspelled" words, to satisfy the new CSpell linter 📌 Use CSPELL to fix spelling errors and add custom dictionary Active , which was running in my local pipeline → (but doesn't appear to run in this module's CI yet).
- I told eslint to ignore minified code, code generated by / downloaded by CKEditor, and the CKEditor code translations.
- I applied the automated linter suggestions for eslint.
- I configured the CSpell lint to ignore the minified code, the code generated by / downloaded by CKEditor, and the CKEditor code translations. This allowed me to drastically reduce the number of misspelled words. The remaining ones are variable names, so I don't want to fix them until I have automated tests in place.
- In trying to fix the remaining eslint issues, I updated the libraries file to note that this project's JS "glue code" depends on the core/jquery and core/drupal libraries, and also removed an import in the webpack configuration that wasn't being used.
- I ignored the rest of the eslint notices so that we can fix them later, if ever. I daresay some of them will go away as more contrib projecdts run into the same sort of things we're doing, and the rules get updated.
- When I was running the pipelines locally, I noticed that the script would rewrite
composer.json
; and the new version used 4 spaces instead of 2, so I reformattedcomposer.json
so it was easier to see whether the rewritten code was useful in any way. It was not (seems to be an imperfect side-effect of testing locally), but I decided to keep the commit anyway. - I did notice that the SPDX license list now considers the "GPL-2.0+" license identifier deprecated, and prefers "GPL-2.0-or-later", so I fixed that in composer.json.
- Finally, I tried tracking down the source of the PHPStan errors, and discovered that it was complaining because it was testing on Drupal 10, but it depended on
\Drupal\ckeditor_abbreviation\Plugin\CKEditorPlugin\AbbreviationCKEditorButton
depends on some CKEditor 4 classes, which are now in the CKEditor [4] module, so I added a test dependency on it. As an aside, we should probably drop support for CKEditor 4, given that the CKEditor 4 module is now unmaintained, and has no supported releases, but I daresay this would come in a 2.0.x release. →
I'm going to run some manual tests, and if everything still works, then I will mark as RTBC and assign to @boromino to review.
- Assigned to boromino
- 🇨🇦Canada mparker17 UTC-4
I did some manual tests for the code in this branch, and it works just fine on Drupal 10.1.x so I'm going to move this to RTBC, and assign to @boromino for review.
- Status changed to RTBC
9 months ago 2:41pm 25 February 2024 - 🇨🇦Canada mparker17 UTC-4
Whoops, I said I was going to move this to RTBC but forgot.
- Issue was unassigned.
- Status changed to Fixed
9 months ago 2:25pm 1 March 2024 Automatically closed - issue fixed for 2 weeks with no activity.