Problem/Motivation

The proposed GitLab CI checks report existing PHP coding-standard violations, JavaScript lint errors and spelling findings.

Steps to reproduce

  1. Run Drupal PHPCS, ESLint and CSpell against the current 1.0.x branch.
  2. 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

Command icon 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

nick hope created an issue. See original summary.

nick hope’s picture

Assigned: nick hope » Unassigned
Issue summary: View changes
Status: Active » Needs review

  • nick hope committed 9b69f7a6 on 1.0.x
    chore: #3628803 Fix coding standards, JavaScript lint errors and...
levmyshkin’s picture

Status: Needs review » Fixed

Thanks @nick hope! Reviewed and merged into 1.0.x.

Review notes:

  • Drupal + DrupalPractice PHPCS goes from 186 errors / 28 warnings down to 0 errors / 11 warnings.
  • The removed use statements (File, Xss, Markup, EntityInterface, FileSystemInterface) and the $config variable in GalleryIdHelper::generateId() were all unused.
  • The sanitizeHref() regex rewrites are equivalent: the old and new patterns gave identical results on ~17.8M generated inputs, including javascript:, data: and protocol-relative URLs. The Object.assign() → object spread change in glightbox_inline.js is also equivalent.
  • The typo fixes in the settings form descriptions change a few translatable strings, which is fine.

Note: the new trailing commas in constructor/method signatures need PHP 8.0+, while core_version_requirement still includes ^9.3 (which allows PHP 7.3/7.4). This isn't a regression, since 1.0.x already had one in GLightboxAttachment::__construct() that fails to parse on PHP 7.4. Raising the core requirement can be handled in a follow-up.

Committed as 9b69f7a.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

levmyshkin’s picture

Status: Fixed » Closed (fixed)