chore: #3636948 Fix the coding standards and check merge requests with GitLab CI

Closes https://www.drupal.org/project/earkiv/issues/3636948

One commit per step. The behaviour of the module does not change, except for the help page fix in commit 3. After the last commit, phpcs with the new phpcs.xml.dist (Drupal and DrupalPractice, all file types including Markdown and YAML) reports nothing; before it reported 107 errors and 117 warnings.

Commits

  1. Apply the automatic fixes of phpcbf. Formatting only, made by phpcbf.
  2. Add the missing comments and fix the other findings. Comments for properties, classes, parameters and return values; unused variables and an unused buildEntity() call in ArchiveForm::validateForm() removed; long comment lines wrapped.
  3. Use the plugin manager getters instead of \Drupal calls. The forms use the getters of PluginOptionsTrait. The Filter module is optional, so the Markdown rendering on the help page keeps its \Drupal::service() call with a phpcs:ignore and an explanation. The help page read the README from __DIR__ . '../../../README.md', without a slash, so it was never found; it now uses dirname(__DIR__, 2).
  4. Move the install hooks to earkiv.install. hook_schema() and hook_requirements() must be in the install file; earkiv.module had nothing else and is renamed.
  5. Wrap the README at 80 characters. The text is unchanged.
  6. Add phpcs configuration and GitLab CI. phpcs.xml.dist, and .gitlab-ci.yml from project/gitlab_templates, so that every merge request is checked. The module has no tests yet, and cspell may report words such as the module name.

Testing

  • All PHP files lint, also in each commit.
  • The status report still shows the HTTrack requirement from hook_requirements() in earkiv.install.
  • The settings form and the archive form still validate the plugin settings (e.g. an ftp:// URL and 500 connections are refused).
  • The archive list, schedule list, schedule form, settings page, status report and help page answer 200; the help page shows the README.
  • A job whose start page returns 404 runs through and fails as expected.

AI-Generated: Yes (Used Claude Code to fix the findings, test the module and write this merge request.)

Merge request reports

Loading
Loading