Problem/Motivation
The proposed GitLab CI checks report existing PHP coding-standard violations, JavaScript lint errors and spelling findings.
Steps to reproduce
- Run Drupal PHPCS, ESLint and CSpell against the current
1.0.xbranch. - Observe coding-standard violations, JavaScript lint errors, typos and unrecognized project terms.
Proposed resolution
Apply Drupal coding standards, fix JavaScript lint errors, correct typos and add a dictionary for valid project terms.
The prepared changes pass Drupal PHPCS, ESLint and CSpell. Browser checks confirm unchanged image and inline modal behavior, including caption and URL sanitization. Compatibility with the pending MRs has been checked.
Service-injection recommendations and remaining non-blocking JavaScript warnings are outside this issue.
Remaining tasks
Review and merge the MR.
Issue fork glightbox-3628803
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
nick hope commentedComment #5
levmyshkinThanks @nick hope! Reviewed and merged into 1.0.x.
Review notes:
usestatements (File,Xss,Markup,EntityInterface,FileSystemInterface) and the$configvariable inGalleryIdHelper::generateId()were all unused.sanitizeHref()regex rewrites are equivalent: the old and new patterns gave identical results on ~17.8M generated inputs, includingjavascript:,data:and protocol-relative URLs. TheObject.assign()→ object spread change in glightbox_inline.js is also equivalent.Note: the new trailing commas in constructor/method signatures need PHP 8.0+, while
core_version_requirementstill includes^9.3(which allows PHP 7.3/7.4). This isn't a regression, since 1.0.x already had one inGLightboxAttachment::__construct()that fails to parse on PHP 7.4. Raising the core requirement can be handled in a follow-up.Committed as 9b69f7a.
Comment #7
levmyshkin